Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maurocamerini/som8086
Tiny operating system for the 8086 processor
https://github.com/maurocamerini/som8086
assembly bootloader operating-system virtual-machine
Last synced: 11 days ago
JSON representation
Tiny operating system for the 8086 processor
- Host: GitHub
- URL: https://github.com/maurocamerini/som8086
- Owner: MauroCamerini
- Created: 2024-12-29T04:24:52.000Z (11 days ago)
- Default Branch: main
- Last Pushed: 2024-12-29T04:43:21.000Z (11 days ago)
- Last Synced: 2024-12-29T05:22:32.704Z (11 days ago)
- Topics: assembly, bootloader, operating-system, virtual-machine
- Language: C
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sistema Operativo M 8086 (SOM8086)
*M Operating System 8086*This is a project I worked on during 2015/2016. The goal was to build a tiny operating system for the 8086 processor, which was used in early PCs (the x86 32-bit processor family began in 8086 mode). It is written in C and Assembly.
I made significant progress: I developed a bootloader to boot from a floppy disk that loaded the full binary into memory. Once laoded, the operating system runs command line user interface.
The project, however, did not reach the stage where the OS could load other programs or execute commands. Despite this, I find the repository very interesting and well-documented.
[Legacy documentation (in spanish) here](/docs/LEGACY.md)
---
## Try It Yourself
The repository includes binaries and disk images, so you can test it directly.
- bin/nuleo.bin is the OS binary file.
- disk/DISCOM.IMA is a raw floppy disk image
- disk/CDARNQ.ISO is a CD-ROM image I created (I don’t know how I made it, but it works)Back in the day, it worked. Now, when I created this repository, I tested it with a VirtualBox VM using the disk/CDARNQ.ISO image. While it runs, it does not capture keystrokes.
---
## Instructions
### How to Compile
This project was developed on Windows, so the instructions provided are tailored to that environment. You'll likely need [MinGW](https://www.mingw-w64.org/) to use GCC tools like `make`.#### `nucleo.bin` (Kernel)
The `/src` directory contains a Makefile for compiling the kernel. Use the following command to build it:```bash
make
```It compiles `.asm` and `.c` files into `.obj` files and then links everything into a `.bin` file. Compiler options ensure that only 8086 instructions are used, and the final binary is a pure binary file without a header.
Required tools:
- **`wcc`:** [Open Watcom](https://www.openwatcom.org/) C compiler.
- **`wlink`:** The linker provided with Watcom C/C++.
- **`nasm`:** [NASM, the Netwide Assembler](https://github.com/netwide-assembler/nasm).Ensure these programs are added to the `%PATH%`.
##### NASM Options
- `-f` Specifies the output format: OBJ.##### OpenWatcom `wcc` Options
- `-0` Use 8086 instructions.
- `-d0` Disable debugging information.
- `-ms` Use "small" memory model (CS = ES = DS).
- `-s` Disable stack overflow checks.
- `-wx` Enable maximum warning level.
- `-zl` Exclude library references in the object file.
- `-i` Include directory for `.h` files.---
#### `arranque` (Bootloader)
There is a `crear.bat` (*make*) script to compile the bootloader. It is compiled into exactly 512 bytes and must be written directly to the boot sector of the disk image.---
#### Utilities
Two utilities are provided:
1. **`insarnq`:** Copies the 512 bytes from the `arranque.bin` file to the specified disk image file.
2. **`leernbp`:** Displays the boot sector information of a disk image file.These utilities are standalone tools and must be compiled directly on your PC as the target system, as they are not part of the OS
---
### How to Run
1. Create a 3.5" 1.44MB floppy disk image. I used [WinImage](http://www.winimage.com) by Gilles Vollant, but the website seems broken. Other similar tools may work.
2. Overwrite the boot sector with `arranque.bin` using the `insarnq` utility.
3. Copy `nucleo.bin` into the disk image. **It must be the first file on the disk** because the bootloader blindly loads the first file.
4. Mount the disk image in a virtual machine.
5. Enjoy!