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
- 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.
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
- Data in the bios data area structure: http://www.o3one.org/hwdocs/bios_doc/BIOS_SEG.txt.
- Ralf Brown's Interrupt list (RBIL).
- Design of a General Purpose Memory Allocator for the 4.3BSD UNIX Kernel http://docs.freebsd.org/44doc/papers/kernmalloc.pdf
- "A Scalable Concurrent malloc(3) Implementation for FreeBSD" http://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf
- "Memory Management for High-performance Applications" http://vimeo.com/37143033
- "Hoard: A Fast, Scalable, and Memory-Efficient Allocator for Shared-Memory Multiprocessors" http://www.hoard.org/about
- "Dynamic Storage Allocation: A Survey and Critical Review" http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.47.275 (click on a download link)
- "Understanding the Linux Virtual Memory Manager" http://www.csn.ul.ie/~mel/projects/vm/guide/pdf/understand.pdf
- Doug Lea's dlmalloc http://gee.cs.oswego.edu/dl/html/malloc.html
- John Walker's bget http://www.fourmilab.ch/bget
- Dynamic Storage Allocator discussion, Richard Harter, comp.lang.c, Nov. 11, 1990 http://groups.google.com/group/comp.lang.c/msg/7da27dcbc6e2ace1
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
- 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)
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.
- 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.
- 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
Most will be contained in the manual for your target CPU but see also
- ATA IDE
- http://www.fysnet.net/media_storage_devices.htm (Detailed book on how to communicate with these controller types)
- 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.
- http://www.fysnet.net/the_universal_serial_bus.htm (Detailed book on how to program PCI and all four controller types)
- http://www.fysnet.net/usb.htm (assembly source to a simple Get Descriptor listing)
- Bran's Kernel Development tutorials
- James Molloy's kernel development tutorials
Also, search the Internet for OS development tutorial videos.