2015-09-18 11:36:07 +02:00
2015-09-18 11:36:07 +02:00
2015-09-14 07:14:09 +02:00
2015-09-11 10:17:17 +02:00
2015-09-18 11:36:07 +02:00
2015-09-18 11:36:07 +02:00
2015-09-18 11:36:07 +02:00
2015-09-18 11:36:07 +02:00
2015-09-18 11:36:07 +02:00
2015-09-06 16:22:10 +02:00
2015-09-11 10:17:17 +02:00
2015-09-14 16:51:29 +02:00
2015-09-12 11:37:30 +02:00
2015-09-14 16:51:29 +02:00
2015-09-18 11:36:07 +02:00
2015-09-14 16:51:29 +02:00
2015-09-11 10:17:17 +02:00
2015-09-18 11:36:07 +02:00
2015-09-12 11:37:30 +02:00

x86 Bare Metal Examples

Hello world programs that run without an operating system.

  1. Examples
    1. printf
    2. min
    3. No ld script
    4. NASM
    5. BIOS
      1. BIOS one char
      2. BIOS hello world
      3. BIOS newline
      4. BIOS carriage return
      5. BIOS clear screen
    6. APM
      1. APM shutdown
      2. APM shutdown 2
    7. Multiboot
    8. GRUB
    9. TODO not working
      1. UEFI
    10. Misc
      1. hajji
  2. Theory
    1. Formats
      1. MBR
    2. IO
      1. BIOS
    3. Bibliography
  3. TODO

Getting started

sudo apt-get install build-essential gnu-efi qemu nasm xorriso

Emulator

Run the default program on QEMU:

make run

Run a given program:

make run RUN=min
make run RUN=bios_one_char

Tested on Ubuntu 14.04 AMD64.

Real hardware

Insert an USB, determine its device (/dev/sdX) with:

sudo lsblk
sudo fdisk -l

Pick the .img file that you wan to run and:

sudo dd if=bios_hello_world.img of=/dev/sdX

Then:

  • insert the USB in a computer
  • during boot, hit some special hardware dependant key, usually F12, Esc
  • choose to boot from the USB

Tested on: ThinkPad T400.

Big image

Create a big.img that contains all examples that can be booted from GRUB:

make big-img

Now if you do:

sudo dd if=big.img of=/dev/sdX

you can test several examples with a single USB burn, which is much faster.

Description
No description provided
Readme 1.1 MiB
Languages
Assembly 64.3%
C 27.6%
Makefile 6.8%
Shell 1.2%