ForthOS Setup Now that you have the ForthOS system running on your system, you probably want to set up for ForthOS to use some space on your hard disk. If you ignored the warning before, here it is again:


Before we get to the details, there are a couple ForthOS mechanisms you should understand.

First, in the "drivers" vocabulary there is a variable "ideoff". This variable is automatically set up at boot time--if an FDISK partition of type 158 is found, "ideoff" is set to the sector offset of that partition. In this case, you can use "block" starting at 1 (remember, 0 is not a valid argument to "block" or "buffer") to address the storage within this partition. This is the only supported configuration; if you don't have a partition reserved for ForthOS of type 158 with at least 81920000 bytes, there are parts of ForthOS which will work, but you are on your own.

If you do not have a partition of that type, "ideoff" is set to 0 and "block" and "buffer" will see your entire disk, starting with whatever's located first on the disk. You can see (and modify, and erase) disk labels, filesystems, swap contents--whatever's on your disk. Be careful.

In both cases, before you start modifying disk blocks, you must verify that ForthOS is accessing the disk at the place you expected--unless there's nothing on the disk you care about anyway. One easy way to do this is to place some specific contents on the disk at the place you want ForthOS to use, and then ForthOS's "(blk#) block 256 dump" to see if the contents is where you expected.

For instance, on my system I'd be using disk partition /dev/ad0s2, so once I had backed up my disk, I could do this from UNIX:

	dd bs=4k if=/etc/passwd seek=1 of=/dev/ad0s2

and when booted into ForthOS I should see /etc/passwd contents when I do:

	1 block 512 dump

Ok, so assuming you have a type 158 partition and it has room for 20000 blocks (of 4096 bytes each), it's time to set up the disk. The ForthOS CD has a pair of files, ForthOS1 and ForthOS2, which are the primary and backup boot images. There's also a file SrcFS10000 alongside them which is the system source. Their contents gets moved onto the low part of the partition. On my system, this looks like:

    dd bs=4k skip=1 seek=1 if=ForthOS1 of=/dev/ad0s2

    dd bs=4k seek=100 if=ForthOS2 of=/dev/ad0s2

This uses the UNIX "dd" command to move the blocks around... if you're on some other kind of operating system, you'll have to ask somebody to tell you how to get the equivalent effect. Note that the first 4k block is skipped on both the input and output of ForthOS1. ForthOS doesn't use that first block, and some operating systems will prevent you from writing there anyway, so we just skip over it.

You almost certainly want the system source installed too:

    dd bs=4k seek=10000 if=SrcFS10000 of=/dev/ad0s2

At this point, you should be able to use GRUB to bootload from these blocks you've installed in the first part of the partition. Reboot into GRUB from the CD, and hit ESC (the escape key) to get into GRUB command mode. A GRUB command sequence like the following should do the trick:

    root= (hd0,1)
    kernel= 8+700

Hopefully you'll see ForthOS boot up, this time with an image loaded from your hard disk. Assuming this all worked, you should probably proceed onwards to the ForthOS filesystem tutorial.