That sounds plausible, although the current code to set up 64 bit Linux is significantly different from what would need to happen to bootstrap a multiboot compatible kernel. Also we don't load all the way from a disk image and instead set things up from an object file directly as if the bootloader had just run. We load Linux as a 64 bit ELF (which grub doesn't support out of the box) and install part of a structure in memory which I think is similar to the multiboot structure but Linux specific. A multiboot compliant kernel would expect to start in 32 bit protected mode and have an actual multiboot structure set up/filled in. If I remember correctly grub just puts any module files into memory verbatim and provides a pointer in the multiboot structure, so those should be pretty easy to handle once the other parts are taken care of.
You should also be aware that x86 support is a relatively new feature for M5. As you likely know x86 is a sprawling ISA, and it's possible that a non-Linux OS would use some adventurous or not so adventurous features of it that aren't supported or aren't supported well and that Linux gets by without. Starting in 32 bit protected mode should at least partially work since booting APs need to pass through it on their way to 64 bit mode. The basics should be covered, but be suspicious if you see any strange behavior. Please let us know if you run into any bugs or want to contribute an implementation of any missing features. Also be sure to let us know if you have any other questions. Gabe On 01/10/11 02:57, Tim Harris (RESEARCH) wrote: > Hi, > > I'm looking at how easy it would be to boot the x86-64 version of the > Barrelfish OS on m5 (http://www.barrelfish.org/ says more about the project, > although the most recent source release is now getting a bit out of date). > > The OS itself runs on the bare metal. It has fairly limited hardware > requirements -- just processors, memory system, and serial console are > sufficient for it to boot. The work I want to do will mainly involve changes > in the memory system, and I'd expect that TimingSimpleCPU will model the > processor in enough detail. > > On real hardware and qemu we normally use Grub and PXE boot -- there's a > small kernel to load, then a set of ~10 modules for various system processes > and test programs. The kernel itself boots OK, but can't do much without the > modules. > > Does anyone have suggestions for booting this on m5? Barrelfish doesn't > support loading modules from disk, so using a disk image in the normal way > isn't an option :-) > > My initial plan is to extend system.cc to support a simple boot loader for > modules, parsing the Barrelfish menu.lst file, loading the modules, and > creating the multiboot structures to describe what's been loaded. Does that > sound plausible? > > Thanks, > > Tim > > _______________________________________________ > m5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/m5-users _______________________________________________ m5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
