Next:
Part I: Design and
Up:
D R A F
Previous:
D R A F
Contents
Part I: Design and Organization
1 Introduction
1.1 Goals and Scope
1.2 Road Map
1.2.1 Interfaces
1.2.2 Function Libraries
1.2.3 Component Libraries
1.3 Overall Design Principles
1.4 Configuring the OSKit
1.5 Building the OSKit
1.6 Using the OSKit
1.6.1 Example Kernels
1.6.2 Booting Kernels
1.6.3 Command line arguments
2 Execution Environments
2.1 Introduction
2.2 Pure Model
2.3 Impure Model
2.4 Blocking Model
2.5 Interruptible Blocking Model
2.5.1 Use in multiprocessor kernels
Global spin lock:
Spin lock per component:
2.5.2 Use in preemptive kernels
2.5.3 Use in multiple-interrupt-level kernels
2.5.4 Use in interrupt-model kernels
Part II: Interfaces
3 Introduction to OSKit Interfaces
3.1 Header File Conventions
3.1.1 Basic Structure
3.1.2 Namespace Cleanliness
3.2 Common Header Files
3.2.1
boolean.h
: boolean type definitions
3.2.2
compiler.h
: compiler-specific macro definitions
3.2.3
config.h
: OSKit configuration-specific definitions
3.2.4
machine/types.h
: basic machine-dependent types
3.2.5
types.h
: basic machine-independent types
4 The Component Object Model
4.1 Objects and Interfaces
4.1.1 Interface Inheritance and the
IUnknown
Interface
4.1.2 Querying for Interfaces
Semantics of the Query Operation
4.1.3 Reference Counting
Cycles
4.2 Reference and Memory Management Conventions
4.3 Error Handling
4.4 Binary Issues
4.4.1 Interface Structure
4.4.2 Calling Conventions
4.5 Source Issues
4.6 COM Header Files
4.6.1
com.h
: basic COM types and constants
4.6.2
error.h
: error codes used in the OSKit COM interfaces
4.7
oskit_iunknown
: base interface for all COM objects
4.7.1
query
: Query for a different interface to the same object
4.7.2
addref
: Increment an interface's reference count
4.7.3
release
: Release a reference to an interface
4.8
oskit_stream
: standard interface for byte stream objects
4.8.1
read
: Read from this stream, starting at the seek pointer
4.8.2
write
: Write to this stream, starting at the seek pointer
4.8.3
seek
: Change the seek pointer of this stream
4.8.4
setsize
: Set the size of this object
4.8.5
copyto
: Copy data from this object to another stream object
4.8.6
commit
: Commit all changes to this object
4.8.7
revert
: Revert to last committed version of this object
4.8.8
lockregion
: Lock a region of this object
4.8.9
unlockregion
: Unlock a region of this object
4.8.10
stat
: Get attributes of this object
4.8.11
clone
: Create a new stream object for the same underlying object
4.9 Services Registry
4.9.1
oskit_register
: Register an interface in the services registry
4.9.2
oskit_unregister
: Unregister a previously registered interface
4.9.3
oskit_lookup
: Obtain a list of all COM interfaces registered for an IID
4.9.4
oskit_lookup_first
: Obtain the first COM interface registered for an IID
4.10
oskit_lock
: Thread-safe lock interface
4.10.1
lock
: Lock a lock
4.10.2
lock
: Unlock a lock
4.11
oskit_condvar
: Condition variable interface
4.11.1
wait
: Wait on a condition variable
4.11.2
signal
: Signal a condition variable
4.11.3
broadcast
: Broadcast a condition variable
4.12
oskit_lock_mgr
: Lock manager: Interface for creating locks and condition variables
4.12.1
allocate_lock
: Allocate a thread-safe lock
4.12.2
allocate_critical_lock
: Allocate a critical thread-safe lock
4.12.3
allocate_condvar
: Allocate a condition variable
5 Input/Output Interfaces
5.1
oskit_absio
: Absolute I/O Interface
5.1.1
read
: Read from this object, starting at specified offset
5.1.2
write
: Write to this object, starting at specified offset
5.1.3
getsize
: Get the size of this object
5.1.4
setsize
: Set the size of this object
5.2
oskit_asyncio
: Asynchronous I/O Interface
5.3
oskit_blkio
: Block I/O Interface
5.3.1
getblocksize
: Return the minimum block size of this block I/O object
5.3.2
read
: Read from this object, starting at specified offset
5.3.3
write
: Write to this object, starting at specified offset
5.3.4
getsize
: Get the size of this object
5.3.5
setsize
: Set the size of this object
5.4
oskit_bufio
: Buffer-based I/O interface
5.4.1
map
: Map some or all of this buffer into locally accessible memory
5.4.2
unmap
: Release a previously mapped region of this buffer
5.4.3
wire
: Wire a region of this buffer into contiguous physical memory
5.4.4
unwire
: Unwire a previously wired region of this buffer
5.4.5
copy
: Create a copy of the specified portion of this buffer
5.5
oskit_netio
: Network packet I/O interface
5.5.1
push
: Push a packet through to the packet consumer
5.6
oskit_posixio
: POSIX I/O interface
5.6.1
stat
: Get attributes of this object
5.6.2
setstat
: Set the attributes of this object
5.6.3
pathconf
: Get value of a configuration option variable
5.7
oskit_ttystream
: Interface to Unix TTY-like streams
5.7.1
getattr
: Get the stream's current TTY attributes
5.7.2
setattr
: Set the stream's TTY attributes
5.7.3
sendbreak
: Send a break signal
5.7.4
drain
: Wait until all buffered output has been transmitted
5.7.5
flush
: Discared buffered input and/or output data
5.7.6
flow
: Suspend or resume data transmission or reception
6 OSKit Device Driver (OS Environment) Framework
6.1 Introduction
6.1.1 Full versus partial compliance
6.2 Organization
6.3 Driver Sets
6.4 Execution Model
6.4.1 Use in out-of-kernel, user-mode device drivers
Shared interrupt request lines
6.5 Performance
6.6 Device Driver Initialization
6.7 Device Classification
6.8 Buffer Management
6.9 Asynchronous I/O
6.10 Other Considerations
6.11 Common Device Driver Interface
6.11.1
dev.h
: common device driver framework definitions
6.12 Driver Memory Allocation
6.12.1
osenv_memflags_t
: memory allocation flags
6.12.2
osenv_mem_alloc
: allocate memory for use by device drivers
6.12.3
osenv_mem_free
: free memory allocated with osenv_mem_alloc
6.12.4
osenv_mem_get_phys
: find the physical address of an allocated block
6.12.5
osenv_mem_get_virt
: find the virtual address of an allocated block
6.12.6
osenv_mem_phys_max
: find the largest physical memory address
6.12.7
osenv_mem_map_phys
: map physical memory into kernel virtual memory
6.13 DMA
6.13.1
osenv_isadma_alloc
: Reserve a DMA channel
6.13.2
osenv_isadma_free
: Release a DMA channel
6.14 I/O Ports
6.14.1
osenv_io_avail
: Check availability of a range of ports
6.14.2
osenv_io_alloc
: Allocate a range of ports
6.14.3
osenv_io_free
: Release a range of ports
6.15 Hardware Interrupts
6.15.1
osenv_intr_disable
: prevent interrupts in the driver environment
6.15.2
osenv_intr_enable
: allow interrupts in the driver environment
6.15.3
osenv_intr_enabled
: determine the current interrupt enable state
6.15.4
osenv_irq_alloc
: allocate an interrupt request line
6.15.5
osenv_irq_free
: Unregister the handler for the interrupt
6.15.6
osenv_irq_disable
: Disable a single interrupt line
6.15.7
osenv_irq_enable
: Enable a single interrupt line
6.15.8
osenv_irq_pending
: Determine if an interrupt is pending for a single line
6.16 Sleep/Wakeup
6.16.1
osenv_sleep_init
: prepare to put the current process to sleep
6.16.2
osenv_sleep
: put the current process to sleep
6.16.3
osenv_wakeup
: wake up a sleeping process
6.17 Driver-Kernel Interface: Timing
6.17.1
osenv_timer_init
: Initialize the timer support code
6.17.2
osenv_timer_register
: Request a timer handler be called at the specified frequency
6.17.3
osenv_timer_unregister
: Request a timer handler not be called
6.17.4
osenv_timer_spin
: Wait for a specified amount of time without blocking.
6.18 Misc
6.18.1
osenv_vlog
: OS environment's output routine
6.18.2
osenv_log
: OS environment's output routine
6.18.3
osenv_vpanic
: Abort driver set operation
6.18.4
osenv_panic
: Abort driver set operation
6.19 Device Registration
6.20 Block Storage Device Interfaces
6.21 Serial Device Interfaces
Driver-Kernel Interface: (X86 PC) ISA device registration
6.22.1
osenv_isabus_addchild
: add a device node to an ISA bus
6.22.2
osenv_isabus_remchild
: remove a device node from an ISA bus
7 OSKit File System Framework
7.1 Introduction
7.2
oskit_principal
: Principal Interface
7.2.1
getid
: Get the identity attributes of this principal
7.3
oskit_filesystem
: File System Interface
7.3.1
statfs
: Get attributes of this filesystem
7.3.2
sync
: Synchronize in-core filesystem data with permanent storage
7.3.3
getroot
: Return a reference to the root directory of this filesystem
7.3.4
remount
: Update the mount flags of this filesystem
7.3.5
unmount
: Forcibly unmount this filesystem
7.3.6
lookupi
: Lookup a file by inode number
7.4
oskit_file
: File Interface
7.4.1
sync
: Write this file's data and metadata to permanent storage
7.4.2
datasync
: Write this file's data to permanent storage
7.4.3
access
: Check accessibility of this file
7.4.4
readlink
: Read the contents of this symbolic link
7.4.5
open
: Create an open instance of this file
7.4.6
getfs
: Get the filesystem in which this file resides
7.5
oskit_dir
: Directory Interface
7.5.1
lookup
: Look up a file in this directory
7.5.2
create
: Create a regular file in this directory
7.5.3
link
: Link a file into this directory
7.5.4
unlink
: Unlink a file from this directory
7.5.5
rename
: Rename a file from this directory
7.5.6
mkdir
: Create a subdirectory in this directory
7.5.7
rmdir
: Remove a subdirectory from this directory
7.5.8
getdirentries
: Read one or more entries from this directory
7.5.9
mknod
: Create a special file node in this directory
7.5.10
symlink
: Create a symbolic link in this directory
7.5.11
reparent
: Create a virtual directory from this directory
7.6
oskit_openfile
: Open File Interface
7.6.1
getfile
: Get the underlying file object to which this open file refers
7.7 Dependencies on the Client Operating System
7.7.1
oskit_get_call_context
: Get the caller's context
7.7.2
fs_delay
: Wait for a period of time to elapse
7.7.3
fs_vprintf
: Generate formatted output to stdout
7.7.4
fs_vsprintf
: Generate formatted output to a string
7.7.5
fs_panic
: Cleanup and exit
7.7.6
fs_gettime
: Get the current time
7.7.7
fs_tsleep
: Wait for a wakeup on a channel or for a timeout
7.7.8
fs_wakeup
: Wakeup any threads waiting on this channel
7.7.9
fs_malloc
: Allocate memory from the heap
7.7.10
fs_realloc
: Resize a chunk of allocated memory
7.7.11
fs_free
: Free a chunk of allocated memory
8 OSKit Networking Framework
8.1 Introduction
8.2
oskit_socket
: Socket Interface
8.2.1
oskit_socket_factory_t
: socket factories
8.2.2
accept
: accept a connection on a socket
8.2.3
bind
: bind a name to a socket
8.2.4
connect
: initiate a connection on a socket
8.2.5
shutdown
: shut down part of a full-duplex connection
8.2.6
listen
: listen for connections on a socket
8.2.7
getsockname
: get socket name
8.2.8
getpeername
: get name of connected peer
8.2.9
getsockopt, setsockopt
: get and set options on sockets
8.2.10
recvfrom, recvmsg
: receive a message from a socket
8.2.11
sendto, sendmsg
: send a message from a socket
Part III: Function Libraries
9 Minimal C Library:
liboskit_c.a
9.1 Introduction
9.2 Extended POSIX Support
9.3 Unsupported Features
9.4 Header Files
9.4.1
a.out.h
: semi-standard
a.out
file format definitions
9.4.2
alloca.h
: explicit stack-based memory allocation
9.4.3
assert.h
: program diagnostics facility
9.4.4
ctype.h
: character handling functions
9.4.5
errno.h
: error numbers
9.4.6
fcntl.h
: POSIX low-level file control
Extended functionality.
9.4.7
float.h
: constants describing floating-point types
9.4.8
limits.h
: architecture-specific limits
9.4.9
malloc.h
: memory allocator definitions
9.4.10
math.h
: floating-point math functions and constants
9.4.11
netdb.h
: definitions for network database operations
9.4.12
setjmp.h
: nonlocal jumps
9.4.13
signal.h
: signal handling
9.4.14
stdarg.h
: variable arguments
9.4.15
stddef.h
: common definitions
9.4.16
stdio.h
: standard input/output
9.4.17
stdlib.h
: standard library functions
9.4.18
string.h
: string handling functions
9.4.19
strings.h
: string handling functions (deprecated)
9.4.20
sys/gmon.h
: GNU profiling support definitions
9.4.21
sys/ioctl.h
: I/O control definitions
9.4.22
sys/mman.h
: memory management and mapping definitions
9.4.23
sys/reboot.h
: reboot definitions (deprecated)
9.4.24
sys/signal.h
: signal handling (deprecated)
9.4.25
sys/stat.h
: file operations
Extended functionality.
9.4.26
sys/termios.h
: terminal handling functions and definitions (deprecated)
9.4.27
sys/time.h
: timing functions
Extended functionality.
9.4.28
sys/wait.h
: a POSIX wait specification
9.4.29
sys/types.h
: general POSIX types
9.4.30
termios.h
: terminal handling functions and definitions
9.4.31
unistd.h
: POSIX standard symbolic constants
Extended functionality.
9.5 Memory Allocation
9.5.1
malloc_lmm
: LMM pool used by the default memory allocation functions
9.5.2
malloc
: allocate uninitialized memory
9.5.3
mustmalloc
: allocate uninitialized memory and panic on failure
9.5.4
memalign
: allocate aligned uninitialized memory
9.5.5
calloc
: allocate cleared memory
9.5.6
mustcalloc
: allocate cleared memory and panic on failure
9.5.7
realloc
: change the size of an existing memory block
9.5.8
free
: release an allocated memory block
9.5.9
smalloc
: allocated uninitialized memory with explicit size
9.5.10
smemalign
: allocate aligned memory with explicit size
9.5.11
sfree
: release a memory block with explicit size
9.5.12
mallocf
: allocate uninitialized memory with explicit LMM flags
9.5.13
memalignf
: allocate aligned uninitialized memory with explict LMM flags
9.5.14
smallocf
: allocated uninitialized memory with explicit size and LMM flags
9.5.15
smemalignf
: allocate aligned memory with explicit size and LMM flags
9.5.16
morecore
: add memory to
malloc
memory pool
9.5.17
mem_lock
: Lock access to
malloc
memory pool
9.5.18
mem_unlock
: Unlock access to
malloc
memory pool
9.6 Standard I/O Functions
9.7 Termination Functions
9.7.1
exit
: terminate normally
9.7.2
abort
: terminate abnormally
9.7.3
panic
: terminate abnormally with an error message
9.8 Miscellaneous Functions
9.8.1
ntohl
: convert 32-bit long word from network byte order
9.8.2
ntohs
: convert 16-bit short word from network byte order
9.8.3
hexdump
: print a buffer as a hexdump
9.9 Extended POSIX Support Initialization Functions
9.9.1
oskit_init_libc
: Initialize the OSKit C library
9.9.2
fd_set_console
: initialize
stdin
,
stdout
and
stderr
Note:
9.9.3
set_system_clock
: initialize clock support
9.9.4
fs_init
: Provide a root directory defining the file system namespace
9.9.5
fs_release
: Release root and current directory references
9.9.6
fs_mount, fs_unmount
: Compose file system name spaces
10 Kernel Support Library:
liboskit_kern.a
10.1 Introduction
10.1.1 Machine-dependence of code and interfaces
10.1.2 Generic versus Base Environment code
10.1.3 Road Map
10.2 Machine-independent Facilities
10.2.1
page.h
: Page size definitions
10.2.2
spin_lock.h
: Spin locks
10.2.3
queue.h
: Generic queues
10.2.4
debug.h
: debugging support facilities
10.2.5
base_critical
: simple critical section support
(X86) Generic Low-level Definitions
10.3.1
asm.h
: assembly language support macros
Symbol name extension:
Alignment:
10.3.2
eflags.h
: Processor flags register definitions
10.3.3
proc_reg.h
: Processor register definitions and accessor functions
10.3.4
debug_reg.h
: Debug register definitions and accessor functions
10.3.5
fp_reg.h
: Floating point register definitions and accessor functions
10.3.6
far_ptr.h
: Far (segment:offset) pointers
10.3.7
pio.h
: Programmed I/O functions
10.3.8
seg.h
: Segment descriptor data structure definitions and constants
10.3.9
gate_init.h
: Gate descriptor initialization support
10.3.10
trap.h
: Processor trap vectors
10.3.11
paging.h
: Page translation data structures and constants
10.3.12
tss.h
: Processor task save state structure definition
(X86 PC) Generic Low-level Definitions
10.4.1
irq_list.h
: Standard hardware interrupt assignments
10.4.2
pic.h
: Programmable Interrupt Controller definitions
10.4.3
keyboard.h
: PC keyboard definitions
10.4.4
rtc.h
: NVRAM Register locations
(X86) Processor Identification and Management
10.5.1
cpu_info
: CPU identification data structure
10.5.2
cpuid
: identify the current CPU
10.5.3
cpu_info_format
: output a cpu_info structure in ASCII form
10.5.4
cpu_info_min
: return the minimum feature set of two CPU information structures
10.5.5
cpu_info_dump
: pretty-print a CPU information structure to the console
10.5.6
i16_enter_pmode
: enter protected mode
10.5.7
i16_leave_pmode
: leave protected mode
10.5.8
paging_enable
: enable page translation
10.5.9
paging_disable
: disable page translation
10.5.10
gate_init
: install gate descriptors
(X86) Base Environment
10.6.1 Memory Model
10.6.2
base_vm.h
: definitions for the base virtual memory environment
10.6.3
base_cpu_setup
: initialize and activate the base CPU environment
10.6.4
base_cpu_init
: initialize the base environment data structures
10.6.5
base_cpu_load
: activate the base processor execution environment
10.6.6
base_cpuid
: global variable describing the processor
10.6.7
base_stack.h
: default kernel stack
(X86) Base Environment: Segmentation Support
10.7.1
base_gdt
: default global descriptor table for the base environment
10.7.2
base_gdt_init
: initialize the base GDT to default values
10.7.3
base_gdt_load
: load the base GDT into the CPU
10.7.4
base_idt
: default interrupt descriptor table
10.7.5
base_idt_load
: load the base IDT into the current processor
10.7.6
base_tss
: default task state segment
10.7.7
base_tss_init
: initialize the base task state segment
10.7.8
base_tss_load
: load the base TSS into the current processor
(X86) Base Environment: Trap Handling
10.8.1
trap_state
: saved state format used by the default trap handler
10.8.2
base_trap_init
: initialize the processor trap vectors in the base IDT
10.8.3
base_trap_inittab
: initialization table for the default trap entrypoints
10.8.4
base_trap_handlers
: Array of handler routines for hardware traps
10.8.5
base_trap_default_handler
: default trap handler for unexpected traps
10.8.6
trap_dump
: dump a saved trap state structure
10.8.7
trap_dump_panic
: dump a saved trap state structure
(X86) Base Environment: Page Translation
10.9.1
base_paging_init
: create minimal kernel page tables and enable paging
10.9.2
base_pdir_pa
: initial kernel page directory
10.9.3
pdir_find_pde
: find an entry in a page directory given a linear address
10.9.4
ptab_find_pte
: find an entry in a page table given a linear address
10.9.5
pdir_find_pte
: look up a page table entry from a page directory
10.9.6
pdir_get_pte
: retrieve the contents of a page table entry
10.9.7
ptab_alloc
: allocate a page table page and clear it to zero
10.9.8
ptab_free
: free a page table allocated using ptab_alloc
10.9.9
pdir_map_page
: map a 4KB page into a linear address space
10.9.10
pdir_unmap_page
: unmap a single 4KB page mapping
10.9.11
pdir_map_range
: map a contiguous range of physical addresses
10.9.12
pdir_prot_range
: change the permissions on a mapped memory range
10.9.13
pdir_unmap_range
: remove a mapped range of linear addresses
10.9.14
pdir_clean_range
: free unused page table pages in a page directory
10.9.15
pdir_dump
: dump the contents of a page directory and all its page tables
10.9.16
ptab_dump
: dump the contents of a page table
(X86) Base Environment: Protected-mode entry and exit
(X86 PC) Base Environment: Physical Memory Management
10.11.1
phys_lmm.h
: Physical memory management for PCs
10.11.2
phys_mem_max
: Highest physical memory address
10.11.3
phys_lmm_init
: Initialize kernel physical memory LMM
10.11.4
phys_lmm_add
: Add memory to the kernel physical memory LMM
(X86 PC) Base Environment: Interrupt Support
10.12.1
base_irq.h
: Hardware interrupt definitions for standard PCs
10.12.2
base_irq_handlers
: Array of handler routines for hardware interrupts
10.12.3
base_irq_init
: Initialize hardware interrupts
10.12.4
base_irq_inittab
: initialization table for default interrupt entrypoints
10.12.5
base_irq_default_handler
: default IRQ handler for unexpected interrupts
10.12.6
base_irq_nest
: interrupt nesting counter and software interrupt flag
10.12.7
base_irq_softint_request
: request a software interrupt
10.12.8
base_irq_softint_handler
: handler for software interrupts
(X86 PC) Base Environment: Console Support
10.13.1
base_console.h
: definitions for base console support
10.13.2
base_console_init
: Initialize the base console
10.13.3
base_cooked_termios
: Default
termios
setting for cooked-mode console
10.13.4
base_raw_termios
: Default
termios
setting for raw-mode console
10.13.5
direct_cons_getchar
: wait for and read a character from the keyboard
10.13.6
direct_cons_putchar
: write a character to the video console
10.13.7
direct_cons_trygetchar
: read an available character from the keyboard
10.13.8
com_cons_init
: initialize a serial port
10.13.9
com_cons_getchar
: wait for and read a character from a serial port
10.13.10
com_cons_putchar
: write a character to a serial port
10.13.11
com_cons_flush
: delay until all output is flushed on a serial line
10.13.12
com_cons_enable_receive_interrupt
: enable receive interrupts on a serial port
(X86 PC) MultiBoot Startup
10.14.1 Startup code organization
10.14.2 Startup sequence
10.14.3 Memory model
10.14.4 Command-line arguments
10.14.5 Linking MultiBoot kernels
10.14.6
multiboot.h
: Definitions of MultiBoot structures and constants
10.14.7
boot_info
: MultiBoot information structure
10.14.8
multiboot_main
: general MultiBoot initialization
10.14.9
base_multiboot_init_mem
: physical memory initialization
10.14.10
base_multiboot_init_cmdline
: command-line preprocessing
10.14.11
base_multiboot_find
: find a MultiBoot boot module by name
10.14.12 Multiboot Specification
(X86 PC) Raw BIOS Startup
(X86 PC) DOS Startup
10.17 Remote Kernel Debugging with GDB
10.17.1 Organization of remote GDB support code
10.17.2 Using the remote debugging code
10.17.3 Debugging address spaces other than the kernel's
10.17.4
gdb_state
: processor register state frame used by GDB
10.17.5
gdb_trap
: default trap handler for remote GDB debugging
10.17.6
gdb_copyin
: safely read data from the subject's address space
10.17.7
gdb_copyout
: safely write data into the subject's address space
10.17.8
gdb_trap_recover
: recovery pointer for safe memory transfer routines
10.17.9
gdb_signal
: vector to GDB trap/signal handler routine
10.17.10
gdb_set_trace_flag
: enable or disable single-stepping in a state frame
10.17.11
gdb_breakpoint
: macro to generate a manual instruction breakpoint
10.18 Serial-line Remote Debugging with GDB
10.18.1 Redirecting console output to the remote debugger
10.18.2
gdb_serial_signal
: primary event handler in the GDB stub
10.18.3
gdb_serial_exit
: notify the remote debugger that the subject is dead
10.18.4
gdb_serial_getchar
: input a character from the remote debugger's console
10.18.5
gdb_serial_putchar
: output a character to the remote debugger's console
10.18.6
gdb_serial_puts
: output a line to the remote debugger's console
10.18.7
gdb_serial_recv
: vector to GDB serial line receive function
10.18.8
gdb_serial_send
: vector to GDB serial line send function
gdb_pc_com_init
: (X86 PC) set up serial-line debugging over a COM port
10.19 Annotations
anno.h
: (X86) generic macros to place annotations in kernel code.
10.19.2
anno_dump
: dump all annotation tables
10.19.3
anno_find_exact
: find annotation table exactly entry matching a value.
10.19.4
anno_find_lower
: find greatest annotation table entry below a value.
10.19.5
anno_init
: initialize annotation tables and sort the entries.
anno_intr
: (X86) interrupt annotations
anno_trap
: (X86) trap annotations
10.20 Boot Module Filesystem
10.20.1
oskit_bmod_init
: initialize BMOD filesystem
10.20.2
oskit_bmod_lock
: lock BMOD filesystem
10.20.3
oskit_bmod_unlock
: unlock BMOD filesystem
10.20.4
oskit_bmod_file_set_contents
: replace contents of a BMOD file
10.21 Signals
10.21.1
oskit_sendsig_init
: initialize kernel signal delivery
10.21.2
oskit_sendsig
: deliver a signal
10.21.3
sendsig_trap_handler
: convert trap into a signal
11 Symmetric Multiprocessing:
liboskit_smp.a
11.1 Introduction
11.2 Supported Systems
11.2.1 Intel x86
11.2.2 External dependencies
11.3 API reference
11.3.1
smp_init
: Initializes the SMP startup code
11.3.2
smp_find_cur_cpu
: Return the processor ID of the current processor.
11.3.3
smp_find_cpu
: Return the next processor ID
11.3.4
smp_start_cpu
: Starts a processor running a specified function
11.3.5
smp_get_num_cpus
: Returns the total number of processors
11.3.6
smp_map_range
: Request the OS map physical memory
11.3.7
smp_init_paging
: Tell the SMP code that paging is being enabled
11.3.8
smp_message_pass
: Send an inter-processor interrupt to another CPU
11.3.9
smp_message_pass_enable
:
smp_apic_ack
: (X86) acknowledge an inter-processor interrupt
12 Kernel Device Driver Support:
liboskit_dev.a
12.1 Introduction
12.2 Device Registration
12.3 Naming
12.4 Memory Allocation
12.5 Buffer Management
12.6 Processor Bus Resource Management
Part IV: Component Libraries
13 FreeBSD C Library:
liboskit_freebsd_c.a
13.1 Introduction
13.2 Malloc Support
13.3 Signal Support
13.4 Missing Functionality
13.5 errno.h
13.6 Initialization Functions
13.6.1
oskit_init_libc
: Initialize the OSKit C library
13.6.2
set_system_clock
: initialize clock support
13.6.3
fs_init
: Provide a root directory defining the file system namespace
13.6.4
fs_release
: Release root and current directory references
13.6.5
fs_mount, fs_unmount
: Compose file system name spaces
14 FreeBSD Math Library:
liboskit_freebsd_m.a
14.1 Introduction
14.1.1 Architecture Dependencies
14.1.2 External Dependencies
14.1.3 Caveats
14.2 Functions
15 List-based Memory Manager:
liboskit_lmm.a
15.1 Introduction
15.2 Memory regions
15.2.1 Region flags
15.2.2 Allocation priority
15.3 Example use
15.4 Restrictions and guarantees
15.5 Sanity checking
15.6 API reference
15.6.1
lmm_init
: initialize an LMM pool
15.6.2
lmm_add_region
: register a memory region in an LMM pool
15.6.3
lmm_add_free
: add a block of free memory to an LMM pool
15.6.4
lmm_remove_free
: remove a block of memory from an LMM pool
15.6.5
lmm_alloc
: allocate memory
15.6.6
lmm_alloc_aligned
: allocate memory with a specific alignment
15.6.7
lmm_alloc_gen
: allocate memory with general constraints
15.6.8
lmm_alloc_page
: allocate a page of memory
15.6.9
lmm_free
: free previously-allocated memory
15.6.10
lmm_free_page
: free a page allocated with lmm_alloc_page
15.6.11
lmm_avail
: find the amount of free memory in an LMM pool
15.6.12
lmm_find_free
: scan a memory pool for free blocks
15.6.13
lmm_dump
: display the free memory list in an LMM pool
16 Address Map Manager:
liboskit_amm.a
16.1 Introduction
16.2 Addresses and attributes
16.3 Address maps and entries
16.4 Simple interface
16.5 Generic interface
16.6 Generic interface example
16.7 External dependencies
16.8 API reference
16.8.1
amm_alloc_func
: Allocate an AMM map entry (user-provided callout)
16.8.2
amm_allocate
: Allocate an address range in an AMM (simple interface)
16.8.3
amm_deallocate
: Deallocate an address range in an AMM (simple interface)
16.8.4
amm_destroy
: Destroy an AMM
16.8.5
amm_dump
: display the AMM-private data for every entry in an AMM
16.8.6
amm_entry_
field
: Accessor macros for AMM-private data members
16.8.7
amm_find_addr
: Locate the map entry containing a specific address
16.8.8
amm_find_gen
: Locate a map entry matching specified criteria
16.8.9
amm_free_func
: Free an AMM map entry (user-provided callout)
16.8.10
amm_init
: initialize an address map (simple interface)
16.8.11
amm_init_gen
: initialize an address map
16.8.12
amm_iterate
: Call a user-defined function for every entry in an AMM (simple interface)
16.8.13
amm_iterate_func
: Function to call with every AMM entry (user-provided callout)
16.8.14
amm_iterate_gen
: Call a user-defined function for select entries in an AMM
16.8.15
amm_join_func
: Join two adjacent map entries (user-provided callout)
16.8.16
amm_modify
: Modify the attributes of an address range
16.8.17
amm_protect
: Modify the attribute flags of an address range in an AMM (simple interface)
16.8.18
amm_reserve
: Mark as unavailable an address range in an AMM (simple interface)
16.8.19
amm_select
: Returns an entry describing an address range exactly
16.8.20
amm_split_func
: Split a map entry into two entries (user-provided callout)
17 Simple Virtual Memory:
liboskit_svm.a
17.1 Introduction
17.2 API reference
17.2.1
svm_init
: initialize SVM system
17.2.2
svm_alloc
: allocate a region of virtual memory
17.2.3
svm_dealloc
: deallocate a region of virtual memory
17.2.4
svm_protect
: control the protection of a region of virtual memory
18 POSIX Threads:
liboskit_threads.a
18.1 Introduction
18.2 Examples and Caveats
18.3 POSIX Threads Reference
18.3.1
pthread.h
: Thread constants and data structures
18.3.2
pthread_init
: Initialize the threads system
18.3.3
pthread_attr_init
: Initialize a thread attributes object
18.3.4
pthread_attr_setdetachstate
: Set the detach state in a thread attributes object
18.3.5
pthread_attr_setprio
: Set the priority in a thread attributes object
18.3.6
pthread_attr_setstackaddr
: Set the stack address in a thread attributes object
18.3.7
pthread_attr_setguardsize
: Set the stack guard size in a thread attributes object
18.3.8
pthread_attr_setstacksize
: Set the stack size in a thread attributes object
18.3.9
pthread_attr_setschedpolicy
: Set the scheduling policy in a thread attributes object
18.3.10
pthread_mutexattr_init
: Initialize a mutex attributes object
18.3.11
pthread_mutexattr_setprotocol
: Set the protocol attribute of a mutex attributes object
18.3.12
pthread_mutexattr_settype
: Set the type attribute of a mutex attributes object
18.3.13
pthread_condattr_init
: Initialize a condition attributes object
18.3.14
pthread_cancel
: Cancel a running thread
18.3.15
pthread_cleanup_push
: Push a cancellation cleanup handler routine onto the calling thread's cancellation cleanup stack
18.3.16
pthread_setcancelstate
: Set the cancelation state
18.3.17
pthread_setcanceltype
: Set the cancelation type
18.3.18
pthread_testcancel
: Check for a cancelation point
18.3.19
pthread_cond_broadcast
: Wakeup all threads waiting on a condition variable
18.3.20
pthread_cond_destroy
: Destroy a condition variable
18.3.21
pthread_cond_init
: Initialize a condition variable
18.3.22
pthread_cond_signal
: Wakeup one thread waiting on a condition variable
18.3.23
pthread_cond_wait
: Wait on a condition variable
18.3.24
pthread_cond_timedwait
: Wait on a condition variable with timeout
18.3.25
pthread_create
: Create a new thread and start it running
18.3.26
pthread_detach
: Detach a thread from its parent
18.3.27
pthread_exit
: Terminate a thread with status
18.3.28
pthread_join
: Join with a target thread
18.3.29
pthread_key_create
: Create a thread-specific data key
18.3.30
pthread_key_delete
: Delete a thread-specific data key
18.3.31
pthread_setspecific
: Set a thread-specific data value
18.3.32
pthread_getspecific
: Set a thread-specific data value
18.3.33
pthread_mutex_init
: Initialize a mutex object
18.3.34
pthread_mutex_destroy
: Destroy a mutex object
18.3.35
pthread_mutex_lock
: Lock a unlocked mutex object
18.3.36
pthread_mutex_trylock
: Attempt to lock a unlocked mutex object
18.3.37
pthread_mutex_unlock
: Unlock a mutex object
18.3.38
pthread_resume
: Resume a suspended thread
18.3.39
pthread_self
: Return the thread identifier of the current thread
18.3.40
pthread_setprio
: Change the priority of a thread
18.3.41
pthread_setschedparam
: Set the scheduling parameters for a thread
18.3.42
pthread_sleep
: Sleep for an interval of time
18.3.43
pthread_suspend
: Suspend a thread
18.3.44
sched_yield
: Yield the processor
18.3.45
osenv_process_lock
: Lock the process lock
18.3.46
osenv_process_unlock
: Unlock the process lock
18.4 Thread-safe Adaptors
18.4.1
oskit_wrap_socket
: Wrap an
oskit_socket
in a thread-safe adaptor
18.4.2
oskit_wrap_stream
: Wrap an
oskit_stream
in a thread-safe adaptor
18.4.3
oskit_wrap_asyncio
: Wrap an
oskit_asyncio
in a thread-safe adaptor
18.4.4
oskit_wrap_sockio
: Wrap an
oskit_sockio
in a thread-safe adaptor
18.4.5
oskit_wrap_posixio
: Wrap an
oskit_posixio
in a thread-safe adaptor
18.4.6
oskit_wrap_file
: Wrap an
oskit_file
in a thread-safe adaptor
18.4.7
oskit_wrap_dir
: Wrap an
oskit_dir
in a thread-safe adaptor
18.4.8
oskit_wrap_filesystem
: Wrap an
oskit_filesystem
in a thread-safe adaptor
18.4.9
oskit_wrap_openfile
: Wrap an
oskit_openfile
in a thread-safe adaptor
18.4.10
oskit_wrap_blkio
: Wrap an
oskit_blkio
in a thread-safe adaptor
18.4.11
oskit_wrap_absio
: Wrap an
oskit_absio
in a thread-safe adaptor
19 Memory Debugging Utilities:
liboskit_memdebug.a
19.1 Introduction
19.1.1 Memdebug Library Configuration
19.1.2 Memdebug Library Internals
19.1.3 External Dependencies
19.2 Debugging versions of standard routines
19.3 Additional Debugging Utilities
19.3.1
memdebug_mark
: Mark all currently allocated blocks.
19.3.2
memdebug_check
: Look for blocks allocated since mark that haven't been freed.
19.3.3
memdebug_ptrchk
: Check validity of a pointer's fence-posts
19.3.4
memdebug_sweep
: Check validity of all allocated block's fence-posts
19.3.5
memdebug_printf
: A printf-style routine guaranteed not to allocate memory
19.3.6
memdebug_bogosity
: Prints a memdebug bogosity message
19.3.7
memdebug_store_backtrace
: Stores call-stack trace in provided buffer
20 Profiling Support:
liboskit_gprof.a
20.1 Introduction
20.2 Caveats
20.3 API reference
20.3.1
profil
: Enable, disable, or change statistical sampling
20.3.2
moncontrol
: enable or disable profiling
20.3.3
monstartup
: Start profiling for the first time
20.4 Using gprof
20.5 Files
20.6 Changing parameters and other FAQs
20.6.1 The sampling rate
20.6.2 How can I temporarily disable gprof's output while still linking it in?
20.6.3 Why isn't there a command line option for it?
20.6.4 Why don't my assembly routines register properly with mcount?
20.6.5 Why is the call graph wrong when a routine was called from an assembly function?
20.6.6 What will gprof break?
21 Disk Partition Interpreter:
liboskit_diskpart.a
21.1 Introduction
21.2 Supported Partitioning Schemes
21.3 Example Use
21.3.1 Reading the partition table
21.3.2 Using Partition Information
21.4 Restrictions
21.4.1 Endian
21.4.2 Nesting
21.4.3 Lookup
21.5 API reference
21.5.1
diskpart_get_partition
: initialize an array of partition entries
21.5.2
diskpart_read_func
: read a disk sector (user-provided callout)
21.5.3
diskpart_blkio_get_partition
: initialize an array of partition entries
21.5.4
diskpart_fill_entry
: initialize a single partition entry
21.5.5
diskpart_dump
: print a partition entry to stdout
21.5.6
diskpart_lookup_bsd_compat
: search for a partition entry
21.5.7
diskpart_lookup_bsd_string
: search for a partition entry
21.5.8
diskpart_blkio_lookup_bsd_string
: search for a partition entry
21.5.9
diskpart_get_
type
: Search for
type
type partitions
22 File System Reader:
liboskit_fsread.a
22.1 Introduction
22.2 External dependencies
22.3 Limitations
22.4 API reference
22.4.1
fsread_open
: Open a file on various filesystems
22.4.2
fsread_
FSTYPE
_open
: Open a file on the
FSTYPE
filesystem
23 Executable Program Interpreter:
liboskit_exec.a
23.1 Header Files
23.1.1
exec.h
: definitions for executable interpreter functions
23.1.2
a.out.h
: semi-standard
a.out
file format definitions
23.1.3
elf.h
: standard 32-bit ELF file format definitions
23.2 Types
23.2.1
exec_read_func_t
: executable file reader callback
23.2.2
exec_read_exec_func_t
: executable file reader callback
23.2.3
exec_sectype_t
: section type flags word
23.2.4
exec_info_t
: executable information structure
23.3 Function Reference
23.3.1
exec_load
: detect the type of an executable file and load it
23.3.2
exec_load_elf
: load a 32-bit ELF executable file
23.3.3
exec_load_aout
: load an
a.out
-format executable file
24 Linux File Systems:
liboskit_linux_fs.a
24.0.4
fs_linux_init
: Initialize the Linux fs library
24.0.5
fs_linux_mount
: Mount a filesystem via the Linux fs library
25 NetBSD File Systems:
liboskit_netbsd_fs.a
25.0.6
fs_netbsd_init
: Initialize the NetBSD fs library
25.0.7
fs_netbsd_mount
: Mount a filesystem via the Netbsd fs library
26 FreeBSD Networking:
liboskit_freebsd_net.a
A note of caution.
26.1 Introduction
26.2 Header Files
26.2.1
freebsd.h
: definitions for the FreeBSD-derived networking code
26.3 Interfaces
26.3.1
oskit_freebsd_net_init
: initialize the networking code
26.3.2
oskit_freebsd_net_open_ether_if
: find and open an ethernet interface
26.3.3
oskit_freebsd_net_open_first_ether_if
: find and open first ethernet interface
26.3.4
oskit_freebsd_net_close_ether_if
: close an ethernet interface
26.3.5
oskit_freebsd_net_ifconfig
: configure an interface
26.3.6
oskit_freebsd_net_add_default_route
: set a default route
27 BOOTP Support:
liboskit_bootp.a
27.1 Introduction
27.2 External Dependencies
27.3 API reference
27.3.1
bootp_net_info
: BOOTP protocol information structures
27.3.2
bootp_gen
: Generate a BOOTP protocol request
27.3.3
bootp
: Generate a BOOTP protocol request (simple interface)
27.3.4
bootp_free
: Free the result of a BOOTP request
27.3.5
bootp_dump
: Dump the result of a BOOTP via printf
28 HPFQ: Hierarchical Network Link Sharing:
liboskit_hpfq.a
28.1 Introduction
28.2 Configuration
28.3 Usage
28.4 API reference
28.5 External Requirements and Constructors
28.5.1
oskit_pfq_root
: the root node scheduler
28.5.2
oskit_pfq_reset_path
: pointer to the
reset_path
function
28.5.3
pfq_sff_create_root
: create a root node implementing SFF
28.5.4
pfq_ssf_create_root
: create a root node implementing SSF
28.5.5
pfq_sff_create
: create an intermediate node implementing SFF
28.5.6
pfq_ssf_create
: create an intermediate node implementing SSF
28.5.7
pfq_leaf_create
: create a leaf node
28.6
pfq_sched
: Interface to PFQ Schedulers
28.6.1
pfq_sched_add_child
: add a child to a root or intermediate node
28.6.2
pfq_sched_remove_child
: remove a child from a root or intermediate node
28.6.3
pfq_sched_set_share
: allocate a percentage of the parent's bandwidth
28.7
pfq_leaf
: Interface to PFQ Leaf Nodes
28.7.1
pfq_leaf_add_child
: add a child to a root or intermediate node
28.7.2
pfq_leaf_remove_child
: remove a child from a root or intermediate node
28.7.3
pfq_leaf_set_share
: allocate a percentage of the parent's bandwidth
28.7.4
pfq_leaf_get_netio
: get the
oskit_netio
corresonding to this leaf
29 Linux Driver Set:
liboskit_linux_dev.a
29.1 Initialization and Registration
29.1.1
oskit_linux_init_devs
: Initialize and register all known drivers
29.1.2
oskit_linux_init_net
: Initialize and register known network drivers
29.1.3
oskit_linux_init_ethernet
: Initialize and register known Ethernet network drivers
29.1.4
oskit_linux_init_scsi
: Initialize and register known SCSI disk drivers
29.1.5
oskit_linux_init_ide
: Initialize and register known IDE disk drivers
29.1.6
oskit_linux_init_scsi_
name
: Initialize and register a specific SCSI disk driver
29.1.7
oskit_linux_init_ethernet_
name
: Initialize and register a specific Ethernet network driver
29.2 Obtaining object references
29.2.1
oskit_linux_block_open
: Open a disk given its Linux name
29.2.2
oskit_linux_block_open_kdev
: Open a disk given its Linux kdev
29.2.3
oskit_linux_netdev_find
: Open a netcard given its Linux name
29.2.4
oskit_linux_net_open
: Open a netcard given its Linux name
29.3 Introduction
29.4 Partially-compliant Drivers
29.5 Internals
29.5.1 Namespace Management Rules
29.5.2 Variables
29.5.3 Functions
29.5.4 Directory Structure
29.6 Block device drivers
29.7 Network drivers
29.8 SCSI drivers
30 FreeBSD Driver Set:
liboskit_freebsd_dev.a
30.1 Introduction
30.2 Supported Devices
30.3 Header Files
30.3.1
freebsd.h
: common device driver framework definitions
30.4 Interfaces
30.4.1
oskit_freebsd_init
: Initialize and FreeBSD device driver support package
30.4.2
oskit_freebsd_init_devs
: Initialize and register all FreeBSD device drivers
30.4.3
oskit_freebsd_init_isa
: Initialize and register all FreeBSD ISA bus device drivers
30.4.4
oskit_freebsd_init_
driver
: Initialize and register a single FreeBSD device driver
30.5 ``Back door'' Interfaces
30.5.1
oskit_freebsd_chardev_open
: Open a character device using a FreeBSD major/minor device value
30.5.2
oskit_freebsd_xlate_errno
: Translate a FreeBSD error number
31 WIMPi Window Manager:
liboskit_wimpi.a
31.1 Introduction
31.2 So how do I use this?
31.3 Dependencies
31.4 API reference
31.4.1
wimpi_initialize
: Initialize the wimpi code
31.4.2
wimpi_main_loop
: Start main wimpi event loop
31.4.3
wimpi_create_toplevel
: Create a top level wimpi window
31.4.4
wimpi_destroy_toplevel
: Destroy a top level wimpi window
31.4.5
wimpi_kbd_input
: Send keyboard input to wimpi
31.4.6
wimpi_mouse_input
: Send mouse input to wimpi
31.4.7
wimpi_set_event_handler
: Register a callback function for event handling
31.4.8
wimpi_set_input_routine
: Register a callback function for input to wimpi
31.4.9
wimpi_send_expose_event
: Send and expose event to a window
31.4.10
wimpi_send_mouse_event
: Send a mouse event to a window
31.4.11
wimpi_send_move_resize_event
: Send a move/resize event to a window
31.4.12
wimpi_send_destroy_event
: Send a destroy event to a window
31.4.13
wimpi_create_window
: Create a sub window
31.4.14
wimpi_destroy_window
: Destroy a sub window
31.4.15
wimpi_map_window
: Map a sub window
31.4.16
wimpi_unmap_window
: Unmap a sub window
31.4.17
wimpi_raise_window
: Raise a sub window
31.4.18
wimpi_lower_window
: Lower a sub window
31.4.19
wimpi_set_window_background
: Set a window's background color
31.4.20
wimpi_set_foreground
: Set a window's foreground color
31.4.21
wimpi_clear_area
: Clear a section of a window
31.4.22
wimpi_move_resize_window
: Move/resize a window
31.4.23
wimpi_fill_rectangle
: Draw a filled rectangular area in a window
31.4.24
wimpi_draw_string
: Draw a string in a window
31.4.25
wimpi_draw_line
: Draw a line in a window
31.4.26
wimpi_draw_arc
: Draw an arc in a window
31.4.27
wimpi_draw_ellipse
: Draw an ellipse in a window
31.4.28
wimpi_draw_rectangle
: Draw a rectangle in a window
31.4.29
wimpi_put_image
: Blit an image into a window
31.4.30
wimpi_copy_area
: Copy a rectangular region in a window
31.4.31
wimpi_set_window_title
: Set the title of a window
31.4.32
wimpi_make_child_window
: Make a child window
32 Video Support:
liboskit_video.a
32.1 Introduction
32.2 X11 S3 Video Library
32.2.1 So how do I use this?
32.2.2 Dependencies
32.2.3 API reference
32.2.4
s3_init_framebuffer
: Initializes the s3 video code
32.2.5
s3_cmap_write
: Write a colormap entry
32.2.6
s3_cmap_read
: Read a colormap entry
32.2.7
s3_cmap_fg_index
: Return the colormap index for the foreground color
32.3 Svgalib Video Library
32.3.1 So how do I use this?
32.3.2 Dependencies
Part V: Utilities
33 Network Booting
33.1 Introduction
33.2 Implementation Issues and Requirements
33.3 Using NetBoot
33.3.1 Booting Another OS
33.3.2 Getting Help
33.3.3 Quitting
Part VI: The Legal Stuff
34 Copyrights and Licenses
34.1 Copyrights & Licenses
34.2 Contributors
34.3 Acknowledgements
34.3.1
liboskit_diskpart.a
34.3.2
liboskit_exec.a
34.3.3
liboskit_freebsd_{dev,net,m}.a
34.3.4
liboskit_kern.a
34.3.5
liboskit_libc.a
34.3.6
liboskit_wimp.a
34.3.7 Various OSKit header files
34.3.8
liboskit_netbsd_fs.a
Index
About this document ...
University of Utah Flux Research Group