If the simulator is run in "bare" mode, the "BIOS" will load the first disk block into a high memory address and then start the machine at that address.
To run an interesting system in this mode, you'll have to create an image file (a disk image) which contains the various components on it. The image should contain a bootloader at block zero. The bootloader will probably want to just stream in the first executable (starting at block one into low memory). This executable is often a simple OS, which will then take control and perhaps launch other processes. The current architecture looks like this:
java asm.Asm bootloader.s java asm.Linker --bare bootloader.s mv a.out bootThe --bare flag links the bootloader as a "raw" executable. That is, it has no executable header or data segment. It is just a sequence of instructions.
trap-handler.s (an interrupt handler) sys.c (system calls, loader, etc).The kernel is just a regular executable, with a small catch. The bootloader simply drops the OS image into memory starting at location zero. Because the first 6 words of the executable descriptor, the first actual instruction of the OS is at location 24. (The trap handler lives at this location.) For this reason, the OS has to be linked to live at a fixed location, namely 24. Make the kernel as follows:
java asm.Asm trap-handler.s java comp.Scc sys.c java asm.Asm sys.s java asm.Linker --at 24 --entry __init trap-handler.o sys.o mv a.out kernelSee the apps/os/Makefile for how to automate this process...
java sim.DiskMake boot kernel app1.exe app2.exeThis will create an image file called "image" and print an index that maps block number to the start of each of the above programs.
java sim.Mips --bare image (for the command line simulator) -- or -- java sim.UI --bare image (for the GUI simulator)