A
This presentation is the property of its rightful owner.
Sponsored Links
1 / 12

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


  • 64 Views
  • Uploaded on
  • Presentation posted in: General

A Smart Port Card Tutorial --- SPC Utilities Edward Spitznagel Washington University [email protected] Utilities - Overview. Purpose of SPC Utilities: glue between various software components simplify other parts of the system solve miscellaneous problems encountered

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


A smart port card tutorial spc utilities edward spitznagel washington university

A

Smart Port Card

Tutorial

---

SPC Utilities

Edward Spitznagel

Washington University

[email protected]


Utilities overview

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


Mkimg overview

mkimg - overview

  • Creates a kernel image suitable for downloading to the SPC

  • Removes some of the burden from the bootloader


Kernel image

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)


Kernel image1

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)


Mkimg summary

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


Mknl purpose

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


Kernel image2

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)


A file with a hole

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

. . .


Output from mknl

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


Mknl implications

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


Conclusion

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


  • Login