Once you have considered your OS design you will need detailed information on hardware and CPU structures. Some information to start you off follows here.
The machine architecture
For the PC architecture including I/O port locations see the following.
- Specific topics on this website
- The Undocumented PC. Frank van Gilluwe
- The Indispensable PC Hardware Book - second edition. Hans-Peter Messmer. Avoid the fourth edition which in many respects is more vague.
- IBM Technical Reference: Personal Computer/AT. Hard copies are out of print and hard to obtain but see http://bitsavers.trailing-edge.com/pdf/ibm/pc/at.
- IBM PS/2 and MCA reference manuals. While few machines still follow the PS/2 specifics the MCA manuals can provide details of operation of the basic PC hardware
- HelpPC
- ISA System Architecture. MindShare Inc. Tom Shanley, Don Anderson.
- PCI System Architecture. MindShare Inc.
- USB System Architecture. MindShare Inc.
- Plug and Play System Architecture. MindShare Inc.
- Other MindShare Inc PC System Architecture Series books.
For the Nintendo DS architecture see nintendo-ds.
For the Raspberry Pi see raspberry-pi.
The CPU
A PC BIOS will boot the first user-provided code in 16-bit (x86-16) Real Mode (RM). If you want to write software to run at that point try a web search for 8086 programming.
You would probably prefer to write for at least the IA-32 Intel 32-bit architecture (also known as i386 or x86-32) as found on 80386 and later CPUs such as 80486, Pentium and 'Core' CPUs from Intel and on Duron, Athlon and Turion CPUs from AMD. Any of these CPUs can be transitioned from Real Mode to Protected Mode (PM). The instruction set of PM is much more regular and is easier to learn and use, albeit that the tables needed to maintain PM add complexity.
- There is a useful online hyperlinked 80386 manual which contains all of the basic architecture information.
- For later information see the Intel Software Developer's Manuals (SDM).
- There is a basic introduction to the 80386 the IA-32 reference implementation.
- Technical x86 processor information http://www.sandpile.org.
- For ARM CPUs see the ARM Information Centre
The BIOS
- http://www.fysnet.net/rombios.htm
- Data in the bios data area structure: http://www.o3one.org/hwdocs/bios_doc/BIOS_SEG.txt.
- HelpPC
- Ralf Brown's Interrupt list (RBIL).
Memory Management
- Design of a General Purpose Memory Allocator for the 4.3BSD UNIX Kernel
- A Scalable Concurrent malloc(3) Implementation for FreeBSD
- Memory Management for High-performance Applications
- Hoard: A Fast, Scalable, and Memory-Efficient Allocator for Shared-Memory Multiprocessors
- Dynamic Storage Allocation: A Survey and Critical Review (click on a download link)
- Understanding the Linux Virtual Memory Manager
- Doug Lea's dlmalloc
- John Walker's bget
- Dynamic Storage Allocator discussion, Richard Harter, comp.lang.c, Nov. 11, 1990
- Offline dynamic storage allocation (DSA)
IA-32 Protected Mode
- Protected Mode (and links to other modes)
- Segment registers real mode vs. protected mode: http://redir.no-ip.org/mirrors/my.execpc.com/~geezer/johnfine/segments.htm
- Protected mode tutorial: http://members.tripod.com/protected_mode
IA-32 Optimization
- Inner Loops: A Sourcebook for Fast 32-bit Software Development. Rick Booth
- Agner Fog's Pentium Optimization http://www.agner.org/optimize
- Agner Fog's Optimization Manual in winhelp format http://www.movsd.com/agner.htm
The Mouse and Keyboard
When programming keyboard operations it helps to bear in mind that the keyboard controller and the keyboard are distinct devices. Although some reference works mix the protocols together each device has its own set of commands and responses as shown below.
For your driver model you may find it helpful to have separate drivers for keyboard and controller. However, they must communicate. The keyboard driver can interact with the keyboard only by talking through the keyboard controller such as by using the services of the keyboard controller driver. Furthermore, a PS/2 mouse driver will also communicate via the same controller.
- The Keyboard Controller
- The Keyboard
- The PS/2 Keyboard Interface
- The PS/2 Mouse Interface
- The PS/2 Mouse/Keyboard Protocol
- Keyboard scancodes and PS/2 mouse handling
- Sample PS/2 Mouse ('Real' mode) code (no int 33h)
- http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc Scancode document (Word format)
File Systems
A list of disk images that you can test your file system code with
Information on specific filesystems
- EXT2fs: An older version of the Linux FS.
- http://e2fsprogs.sourceforge.net/ext2.html
- http://en.wikipedia.org/wiki/Ext2
- http://www.fs-driver.org - An installable EXT2 for Windows
- EXT3fs: Third edition of the Linux FS.
- EXT4fs: Fourth edition of the Linux FS.
- FAT: May be the most common file system for smaller disks, floppies, and other removable media.
- FYSFS: A simple FS created for testing the FYSOS operating systems Virtual FS code.
- HPFS: The FS used on older Mac's and OS/2, though the specs may not be the same for both platforms.
- ISO 9660: A FS used on CDROMs.
- ISO Joliet: A FS used on CDROMs.
- LEAN: A simple but efficient FS for all sizes of disks
- NTFS: The FS used with modern Windows versions.
- Reiser4: A FS that efficiently uses the disk space
- ZFS: From Sun.
File formats
- http://devpit.org/wiki/Compiler_Options_for_Creating_Odd_Binaries
- http://www.wotsit.org lists and describes many file formats
- http://dotwhat.net file extension information and assistance
- http://www.file-extensions.org file extensions and file formats database
Data structures
Most will be contained in the manual for your target CPU but see also
Media Devices
- FDC
- ATA IDE
- SATA/AHCI
Some links:
- http://www.fysnet.net/media_storage_devices.htm (Detailed book on how to communicate with these controller types)
USB
- You will need to know how to program the PCI, either via port IO, or via the BIOS
- You will need to know which type of USB controller you are using: xHCI, EHCI, UHCI, or OHCI.
- The EHCI controller has multiple UHCI or OHCI controllers.
- The xHCI controller handles all speeds of the EHCI, UCHI, and OHCI controllers.
Some links:
- http://www.fysnet.net/the_universal_serial_bus.htm (Detailed book on how to program PCI and all four controller types)
- http://www.usb.org/developers/docs
- http://www.fysnet.net/usb.htm (assembly source to a simple Get Descriptor listing)
Development tutorials
- Bran's Kernel Development tutorials
- James Molloy's kernel development tutorials
- http://www.fysnet.net/the_system_core.htm
Also, search the Internet for OS development tutorial videos.
Other info
- http://www.aarongray.org/AODUBL/bookmarks.html.
- http://www.beyondlogic.org
- http://alasir.com/books/hards/