It is unfortunately not normally possible to build bootable Visopsys images
on non-Linux platforms. The problem lies in the following piece of code in the
setOsLoaderParams() function in src/programs/copy-boot.c (the source code for the copy-boot program, which copies the boot sector on a device or image):
While this piece of code seems to be needed due to a quirk of Linux's FAT filesystem driver, this makes loading vloader (the second-stage bootloader) fail when the FAT filesystem is written using other filesystem drivers (such as NetBSD's).
Code: Select all
#ifdef VISOPSYS // For some reason the Linux driver gives us the second unused cluster firstUnusedCluster += 1; #endif
A provisional solution when building 0.74 is simply to comment the piece of code out. The definitive solution is obviously changing the #ifdef to something like #ifdef linux (check this, I don't remember exactly what is set by the Linux system headers)
Also, the shipped scripts to build floppy and CD images only work for Linux systems, as they use Linux specific utilities and features and they require
being run as root.
It is however possible to make a working floppy image in the following way:
- make a 1440K blank image, and format it using your platform's own tool
Let's call this image testflp.img
- run copy-boot on the image ( ./copy-boot ../build/system/boot/bootsect.fat testflp.img)
- use the tools provided by the MTools suite in order to copy the files on the floppy
image, remembering to first copy vloader (the second-stage bootloader), then visopsys (the kernel) and then everything else
This results is a working floppy image, and it does not even require root priviliges to make.
A CD image is made likewise, just remember to make a root cd filesystem, copy the files for the live CD environment on it, copy the bootable floppy image in it,
and run a tool like mkisofs specifying that you want to make ISO image bootable using floppy emulation.
Notice, also, that GCC versions <= 4.5 miscompile the Visopsys kernel, and you'll run in all kinds of problems. Use a GCC version >= 4.6 and they will go away. Old Visopsys kernel versions compiled fine with GCC <= 4.5, and maybe this has something to do with how fpu registers are backed-up and restored? I don't exactly know, just a guess.