At this stage, the only way to install and execute a new application on your operating system is to recompile the operating system itself. The objective of this milestone is to transition your OS to load and execute programs that are hosted by the NFS server. The CPIO archive should not be required after this milestone is complete (including for sosh).
By this final milestone you should ensure that all I/O is asynchronous. This means that your system must not block waiting for completion of file system or paging I/O, but should be able to run any process that is ready while other processes are blocked on I/O completion.
The libelf
library has been provided for you
in your source tree. You may use this library to handle the parsing
of ELF format files. You will need to modify
apps/sos/src/elf.c
to load executables from
the network file system instead of the cpio image linked with SOS.
Note: you initially only need to read the ELF header of an executable file, in order to parse it and subsequently load it for execution. You can assume the header is less than the page size (4 KiB). You should only read in the file as needed when loading the executable, or completely lazily when the application faults on it.
You may also wish to modify the top level Makefile to
automatically copy your executable files into your NFS
directory (/var/tftpboot/$USER
).
One design decision is whether to load the whole executable image on process creation, or instead load page-wise on demand at page-fault time.
You will demonstrate (by running a sosh
) that your
system works even with repeated and concurrent executions, and
that you can execute every file (of the right content) from your
NFS directory.
The following can be considered stretch goals. They are significantly more work, and the reward is mostly in personal understanding.