The Möbius Operating System: Howto: Boot M&oul;bius
HOME DOWNLOAD DOCUMENTATION SCREENSHOTS  

Howto: Boot Möbius

Tim Robinson

1.Introduction

The Möbius Operating System uses GRUB to boot from a floppy disk, hard disk or network device. Using GRUB means that the Möbius developers can give it a capable boot loader while being able to concentrate on maintaining features more relevant to the operating system as a whole.

2.Installing GRUB

Note: These instructions are based on the ones in the GRUB Tutorial. The ones there are better than these.

You will need two disks:

  • the first disk won't contain a file system and will be used to start GRUB the first time; after that you won't need it
  • the second disk will be the normally-formatted disk you'll use to start The Möbius through GRUB regularly
  1. Get a copy of the GRUB binaries from http://www.gnu.org/software/grub/
  2. Copy stage1 onto the boot sector (sector 0) of a blank floppy disk using; if you're using a UNIX OS or Cygwin on Windows you can use dd for this; alternatively, you might want to try rawrite or partcopy.
  3. Copy stage2 onto sector 1 of the same disk using the same program you used in step (2).
  4. Format another disk as FAT (ext2 works as well)
  5. Copy stage1 and stage2 (and, optionally, menu.lst) onto the second disk as files
  6. Boot from the first disk; the GRUB command line will appear
  7. Swap disks; put the second disk in the drive
  8. Type the following command:
    install (fd0)/stage1 (fd0) (fd0)/stage2 (fd0)/menu.lst
    This installs the stage1 and stage2 loaders onto the second disk using menu.lst as the menu which will be used. menu.lst doesn't need to be there at the time; if it's not present at boot time you'll get the GRUB command line.
  9. Now the second disk will be a normal formatted disk which will boot GRUB.
You might want to mark the stage2 file as system, hidden and read-only, since the only way the boot sector has of finding it is through a block list (if the stage2 file moves the block list doesn't get updated). You can delete stage1 from the disk, however.

3.Booting from Floppy Disk

This section assumes that you have a working GRUB disk with a FAT or ext2 file system (the "second disk" from the section "Installing GRUB").

You will need to copy these files onto your disk as a bare minimum:

  • menu.lst: the configuration file for GRUB
  • kernel.exe: the Möbius kernel
  • system.pro: the Möbius system profile (the kernel configuration file)
  • any drivers referenced by your system.pro
  • shell.exe: the Möbius command-line shell
  • libc.dll: the C runtime library
  • libsys.dll: the Möbius system call library

Listed here are sample menu.lst and system.pro files for a bare configuration (booting from a FAT-formatted floppy disk). If you use this configuration, you will have the following files on the disk:

  • menu.lst
  • kernel.exe
  • system.pro
  • keyboard.drv
  • tty.drv
  • fdc.drv
  • fat.drv
  • shell.exe
  • libc.dll
  • libsys.dll

Code listing 1: menu.lst
default 0
timeout 5

title The Möbius
kernel /kernel.exe
module /system.pro
module /keyboard.drv
module /tty.drv
module /fdc.drv
module /fat.drv
module /shell.exe
module /libc.dll
module /libsys.dll
Code listing 2: system.pro
key Devices
    0=device,tty,tty0
    1=device,tty,tty1
    2=device,keyboard,keyboard
    3=device,fdc,fdc0
    4=mount,fat,/floppy,fdc0
end

Shell=/System/Boot/shell.exe

4.Booting from Hard Disk or a Network

Booting from elsewhere is similar to booting from a floppy disk. This section only provides an overview; for details, refer to the GRUB manual.

If you are booting from a hard disk, the files will come from a directory there instead of from the root directory of a floppy disk. You will need to prepare your hard disk the same way as your second floppy disk; you might want to install the GRUB loader into the master boot record so that you can boot your other operating systems, or you could install it into the boot sector of a separate partition and load it from your usual OS's loader.

Alternatively, you could boot the computer from a floppy disk and load the Möbius files for a directory on your hard disk. This has the advantage that your computer's normal boot process isn't modified, although it is slightly slower that booting straight from hard disk. This is the best method if you don't want to dedicate an entire partition to The Möbius. The easiest way of doing this is to modify the menu.lst on your floppy disk, adding the root (hd0,0) command referring to your hard disk.

Although booting from network is typically slower that from a hard disk, it is the easiest way if you have separate testing and development machines. Booting from the network means that you don't have to update the files on your test machine every time you do a build. To do this, you will need a network card in your test machine that's compatible with GRUB and a TFTP server on your development machine. For details, see http://osdev.berlios.de/netboot.html.

5.Booting inside Bochs

Because Bochs simulates the whole PC environment, booting inside Bochs is identical to booting on real hardware. Where you would use a floppy disk on a real PC, you use a floppy disk image in Bochs; where you would reboot a real PC, you restart Bochs. You can swap disks in Bochs by clicking the floppy disk toolbar icon to remove it, going into the Bochs configuration menu and changing disk file names, then clicking the floppy disk icon again to re-insert the disk.

An easier way to create a bootable Bochs image is to create a normal bootable floppy disk, then using a tool like dd or rawread to copy its contents to a file. You can the use this disk image file to boot Bochs.

A still easier way is to download the lastest Möbius bootimage file from the SourceForge project page and modify the files by mounting it on the loopback device on Linux, or by using a tool such as Winimage (http://www.winimage.com/) or Mtools (http://bochs.sourceforge.net/links.html) on Windows.

Post a comment

From: