Skip to content

How to compile

Lolwis111 edited this page Mar 7, 2019 · 1 revision

How to compile PotatOS

Step 1: run buildTools.sh to compile all the tools needed to build the system

Just type ./buildTools.sh into your terminal and press enter. It is possible to call the Makefiles manually. Check the subfolders of tools/

Step 2: configure build.sh

In the build.sh script it is possible to change some options. Changeable are the language to generate or assembler flags. As well as Debug on/off, High Memory on/off and list file generation on/off

Step 3: run build.sh

build.sh has to be run as root: the call might look like this: sudo ./build.sh This is due to the fact, that the script uses the loopback mounting of linux/unix system to mount the floppy image and copy the files. Feel free to change that however you want. Maybe you have a way that won't require root rights :)

build.sh also allows for some flags that can be passed:

  • ./build.sh clean - only runs the code to clean binaries and list files
  • ./build.sh d|D - d disables debug features/ D enables debug features
  • ./build.sh h|H - h disables high memory features/ H enables high memory features (1)
  • ./build.sh l|L - l disables list file generation/ L enables list file generation

The d, D, h, H, l, L can be combined in any way allowing to use multiple options.

When the script is successful, you should be see a green_(2)_ message saying "Done" as well as time and date of the build. The file potato.img should be in the directory now. This file is a image of an 1.44MB 3.5" floppy. Technically it is possible to write this to a floppy and boot it on a real machine_(3)_

(1) The system has to support the A20 gate and needs at least 1088 KiByte of RAM (~ 1 Megabyte), configure your virtual machine to have 2 Megabytes of RAM to be sure :)

(2) Requires a ANSI compatible terminal. The control sequences get printed if ANSI is not supported.

(3) I do not recommend running it on a real machine unless you really know what you are doing! I cannot guarantee correctness or harmlessness of this code! Please use a virtual machine of your choice to be save!

Step 4: run the system

To run PotatOS feel free to use the supplied run.sh, which will start QEMU with the generated image. I also tested the Bochs Emulator, Oracle VirtualBox and VMWare Player!

On success, you should see the prompt CMD> on your screen with the blinking cursor now!

Clone this wiki locally