Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjiwa/x86-boot-sector-c
A DOS boot sector written in C
https://github.com/kjiwa/x86-boot-sector-c
Last synced: 3 months ago
JSON representation
A DOS boot sector written in C
- Host: GitHub
- URL: https://github.com/kjiwa/x86-boot-sector-c
- Owner: kjiwa
- Created: 2015-03-05T20:24:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-25T01:36:30.000Z (almost 6 years ago)
- Last Synced: 2024-07-17T18:54:59.880Z (4 months ago)
- Language: C
- Homepage: https://crimsonglow.ca/~kjiwa/2010/09/dos-boot-sector.html
- Size: 16.6 KB
- Stars: 26
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- starred-awesome - x86-boot-sector-c - A DOS boot sector written in C (C)
README
# DOS Boot Sector
This is an x86 boot sector written in C. It is meant to bootstrap a DOS system on a FAT volume. A more detailed explanation of the code is available at https://crimsonglow.ca/~kjiwa/2010/09/dos-boot-sector.html.
[View](boot.c) the source. It works like this at a high level:
* get the drive parameters
* load the contents of the root directory into memory
* look for IO.SYS in the root directory
* load the first 3 sectors of IO.SYS into memory and begin executing itI've successfully compiled and tested it with the following tools:
* gcc 4.4.3
* binutils 2.20.1
* dosfstools 3.0.7
* bochs 2.4.2The gcc and binutils host and target are both i386-pc-elf.
```shell
$ make boot # compile and link the boot sector
$ make io # compile and link IO.SYS
$ make disk # create a 10 MB disk image with a FAT volume
$ make deploy # copy the boot sector and IO.SYS to the disk image
```##### External Links #####
* [SYS.COM Requirements in MS-DOS versions 2.0-6.0](http://support.microsoft.com/en-us/kb/66530/en-us)
* [int 13](http://www.ctyme.com/intr/int-13.htm)
* [Memory Map (x86)](http://wiki.osdev.org/Memory_Map_%28x86%29)
* [File Allocation Table](http://en.wikipedia.org/wiki/File_Allocation_Table)