Close

Starting Development

A project log for Fungesector

A Befunge-93 interpreter which runs on x86 real mode

louis-paulLouis Paul 09/09/2024 at 01:310 Comments

For this project log, I'll briefly describe how to write a basic bootloader with 8086 assembly using the tools and documentations available on the internet. I'm using Linux, so the steps and tools used are from the Linux perspective.

So, what you need to develop something for x86 real mode? You'll need a set of tools:

In addition to these tools, you'll need some good documentation with the descriptions of BIOS interrupts. I recommend the HelpPC Reference Library which describes various BIOS interrupts related to disk, video and keyboard services. Also you'll need a x86 instruction reference, which contains a list of opcodes (there are opcodes which aren't available for the original 8086). When developing for the x86 real mode you can't use DOS interrupts (because DOS isn't running on the pendrive).

The biggest challenge when developing for the x86 real mode: there are various flavors of BIOS, each one with unique features and quirks, so it's important to test on various emulators and real hardwares as much as possible.

The code I'm developing will be divided in two parts: the first stage, which is responsible for loading the sectors of pendrive and showing a message if had a error; and the second stage, which will contain the Befunge-93 interpreter.

With the tools and documentations, I've written some code which loads the sectors on the first stage and prints some text on the second stage. The code is a bit disorganized and not well-commented, so for now I'll show the code and the result on a future project log.

Discussions