1 / 12

A Smart Port Card Tutorial --- SPC Utilities Edward Spitznagel Washington University

A Smart Port Card Tutorial --- SPC Utilities Edward Spitznagel Washington University ews1@arl.wustl.edu. Utilities - Overview. Purpose of SPC Utilities: glue between various software components simplify other parts of the system solve miscellaneous problems encountered

anisa
Download Presentation

A Smart Port Card Tutorial --- SPC Utilities Edward Spitznagel Washington University

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Smart Port Card Tutorial --- SPC Utilities Edward Spitznagel Washington University ews1@arl.wustl.edu

  2. Utilities - Overview • Purpose of SPC Utilities: • glue between various software components • simplify other parts of the system • solve miscellaneous problems encountered • There aren’t as many as there used to be. • Utilities that are still useful: • mkimg - make image • mknl - make namelist

  3. mkimg - overview • Creates a kernel image suitable for downloading to the SPC • Removes some of the burden from the bootloader

  4. This is what the NetBSD kernel in a.out format looks like on the disk e.g. the file /netbsdon most systems Kernel Image On Disk: exec header text segment initialized data symbol table (optional) string table (optional)

  5. Kernel Image On Disk: (e.g. the file /netbsd) In Memory: (as loaded by bootloader) • This is what the kernel image looks like when loaded into memory. • What’s different? • BSS segment has been inserted in the middle. exec header exec header text segment text segment initialized data initialized data symbol table (optional) BSS segment (uninitialized data) string table (optional) symbol table (optional) string table (optional)

  6. mkimg - summary • Kernel requires BSS segment for execution. • Normal PC: done at boot time (by the bootloader) • SPC: done by mkimg, after kernel build • mkimg creates a copy of the kernel file with the BSS segment included. • mkimg is invoked by “make” from the mk.3 script

  7. mknl - purpose • Certain system tools need a kernel namelist: • ps, netstat, top, uptime, etc. • Normally, this is read from kernel file (/netbsd) • Problem: kernel too large to fit on filesystem • Solution: • create a file that we can put on the filesystem, to hold the namelist information • file should look as much like the real kernel as possible

  8. mknl utility: input: kernel in a.out format output: the “symbols only” file approach: open input and output files copy exec header lseek past text and data segments copy symbol table and string table close files Kernel Image On Disk: (e.g. the file /netbsd) exec header text segment initialized data symbol table (optional) string table (optional)

  9. a file with a hole • mknl creates a file with a hole • unneeded blocks are not allocated • Example of a file with a hole: block array for the file: disk block disk block null null null null disk block disk block . . .

  10. This is what the symbols-only netbsd file looks like This is what we put into our filesystem as /netbsd Doesn’t require much space typically around 150kB Example: from a 24MB kernel: output from mknl Output file from mknl: exec header hole (used to be text segment) hole (used to be initialized data) 152 -rw-r--r-- 1 root wheel 24624114 /netbsd symbol table string table

  11. mknl - implications • Implication of a files with holes: • Copying can produce undesirable results: holes look like blocks full of zeroes... • new file will be as large as the original kernel • defeats purpose of mknl • Need to mknl directly into the filesystem. • Need to mknl after any changes are made to the kernel. • mknl is invoked by mk.2 script

  12. Conclusion • Utilities • mkimg - make a kernel image suitable for downloading to SPC • mknl - makes a “symbols-only” file to reside on the SPC filesystem • The End

More Related