My setup, overall, is:
- 64 bit CPU
- 32 bit OS (compiled using i686 cross compiler)
- 32 bit applications will be able to be run
I've been running this on a virtualized x86_64
processor.
$ make clean
$ make
$ qemu-system-x86_64 build/unnamed_os.bin
# or for rhel:
$ qemu-kvm -cpu host -drive file=./build/unnamed_os.bin,format=raw -nographic
# View source
$ objdump -D -b binary -mi386 -Maddr32,data32 build/disk.img
x86
: (2.1.1) Refers to a processors in the 8086 family. (80186 80286 80386 80486...). Usually, it means compatability with the 80386 32 bit instruction set because 16 bit only is so oldi686
: (2.1.6) Intel686. P6 Family Microarchitecture on the Pentium Pro.- One of the 6th generation of
x86
processor. i386
: (2.1.3) Intel386. AKA 80386. First 32 bitx86_64
The 64-bit instruction set (sometimes called amd64) brother ofx86
- backwards compatible to
x86
(iex86
instructions can run - on
x86_64
processors)
- backwards compatible to
- Here's a nice summary of intel cpu architecture (chapter 2.1).
- Here's another nice explanation of
i
related architectures - 32 bit and 64 bit:
- A 32-bit OS will run on a 32-bit or 64-bit processor without any problem.
- A 32-bit application will run on a 32-bit or 64-bit OS without any problem.
- But a 64-bit application will only run on a 64-bit OS and a 64-bit OS will only run on a 64-bit processor
- Intel Software Development Manual Volume 1A (Basic Architecture)
- Not going to help you write code, but useful in learning about basics of computer stuff
- Intel Software Development Manual Volume 3A (System Programming Guide Part 1)
- Good reference for GDT, protected mode, paging, etc. (The above also talks about paging, and segmentation)
- OS Dev Wiki
- Eventually, I'll remove these as this grows, but this is the small subset of the wiki I've referenced so far:
- Setting up a gcc cross compiler
- GDT and GDT Tutorial
- Protected mode
- Segmentation
- Rolling your own bootloader
- Bootloader theory
- Assembly cheat sheet
- Daedalus Community - Making an OS
- NASM Reference
- NASM cheat sheet
- Assembly Programming Topics
- TODO - go through this tutorial
- Just a good website