![]() |
VMB BIOS for MMIX |
|
![]() |
Content
|
VMB BIOS for MMIXIn the Virtual Motherboard (VMB) implementation of MMIX, the fixed MMIXware TRAP instructions are no longer built into the CPU simulator, instead the CPU simulator will implement the TRAP instructions as specified in mmix-doc. As a consequence, the functionality of the operating system calls and interrupt handlers must be implemented in MMIX software.A convenient way to implement simple operating systems is by means of a ROM resident BIOS: the operating system code is contained in a ROM image file, loaded by the ROM device, and immediately avialable when the system has started. For convenience, several different BIOS implementations are provided on this page. These implementations are eiter written as simple mms files or, using the GNU toolchain, in C and/or MMIX assembly code. Other specialized BIOS implementations can be found on the pages describing various examples, the smallest BIOS is found in the Stopwatch example and the biggest in the Linux example. The last two sections on this page describe how to build a ROM image from the BIOS source files. BIOS for MMIXwareThis BIOS implementation aims to be
BIOS for VMB devicesThis BIOS implementation aims to provide a standard base for the use of all VMB devices. Ofcourse, such a thing is not possible since the VMB devices are constantly under development. But at least for those devices that are common you can find code here to support them. Since the BIOS code depends on the hardware configuration, the bios commes together with a VMB configuration file.
Creating a BIOS ROM Image from an mmo fileSimple BIOS implementations can be written as mms files (see above). bios.mms for example. This is a regular MMIX assembly code file and you edit this file with an Text Editor, and convert it to an MMIX object file bios.mmo using the commandmmixal bios.mms There is one extra step, to convert an MMIX object file to an image file. This step is performed by the program mmoimg (Win32, Linux) which actually is a modified version of mmotype. This program produces the bios.img file from the bios.mmo file.using the command mmoimg bios.mmo Creating a BIOS Image from an elf fileWhen using the GNU tool chain, object files are build in two steps.First assemby or C file are assembled or compiled to object files like this: mmix-as biosA.s -o biosA.oor for C files mmix-gcc -melf -mabi=mmixware -mno-base-addresses -c -o biosB.o biosB.cFrom one or more object files, the final elf file is produced by the linker, which might add code from libraries (the option -lc below links the C library). The linker can be told at what (virtual) addresses your ROM and RAM devices are located using the --section-start options. mmix-ld -static \ --section-start .text=0x8000000000000000 \ --section-start .bss=0x8000000100000000 \ --oformat elf64-mmix biosA.o biosB.o -lc -o bios.elfFrom the bios.elf file, the GNU tool objcopy can produce the desired image file. s long as you do not have a data section with initialized static data, this is very simple: mmix-objcopy -O binary bios.elf bios.imgIf you have static data, you have to tell the linker that you have different addresses for loading (in ROM) and executing (in RAM), then make the ROM image and finaly at startup copy the data from ROM to RAM. The Linux example uses this technique. |
Please help to keep this site up to date!
If you want to point out important material or projects
that are not listed here, if you find errors or want to suggest improvements,
please send email to