FunOS Documentation

As of March 8, 2000.

Borrowed Linux Initialization Code

bootsect.S, head.S, then setup.S (with video.S)

OS Initialization Code

Scheme init code is stored after the interpreter; execute that.

Overview

init-r5rs.scm
R5RS scheme that isn't implemented in CAML code
init-library.scm
generally useful code that we want to assume we always have
devices.scm
general init code for physical devices
console.scm
code for writing information to the screen
keyboard.scm
code for reading data from the keyboard hw and putting it into a useful format
bit-hack.scm
Common Lisp style bit manipulations (dpb, ldb, ...)
word-vectors.scm
reading and writing vectors of data in memory
queues.scm
simple queues (not used)
init-memory.scm
allocating buffers, allocating memory pages
buffer-cache.scm
accesses to disk are cached and written back when dirty. That code is here.
interrupts.scm
dealing with i386 interrupt descriptors (unfinished)
virtual-memory.scm
i386 page tables
squishy.scm
squishy buffers, i.e. emacs-style text buffers (not used)
fs.scm
ext2 filesystem code (unfinished)

init-r5rs.scm

Fix or add syntax and procedures to the Scheme interpreter to make it r5rs compliant.

init-library.scm

Useful library routines

lcond
cond that allows embedded lets. Maybe not a good idea.
(lcond ((null? list) '())
  (let ((top (car list)))
    ((= top y) #t)
     (else (blah (cdr list)))))
destructuring-bind
binds variables to elements of a list or vector.
(destructuring-bind pattern structure body ...)
(destructuring-bind (a b c . d) '(1 2 3 4 5)
  (format #t "~a ~a ~a ~a~%" a b c d))
=> 1 2 3 (4 5)
pattern-match
like destructuring-bind by sequentially tries multiple patterns.
(pattern-match structure (pattern1 body1 ...) ... (else body ...))
dotimes
Do body n times with var bound to that iteration number. Returns result of return-value expression.
(dotimes (var n return-value) body ...)

devices.scm

block and character devices: ide, partitions

low-read-block
(low-read-block device block number)
Read a block from the device.
low-write-block
(low-write-block device block number buffer)
Write the buffer contents into the device.