*************************
 		Memory Map 
*************************

This file describes the location of global values stored where in memory.

Everything is coded in assembly using NASM.

Code and data are intermixed (flat binary image). 
There are no code/data/bss segments with differant access 
privaledges. Everything has kernel privaledge.


0x7c00        Bios loads first sector of our image to here
0x600         Start of boot2.s
0x10000       Start of tlib
0x15000       Start of application


Globals:

This project does not use a linker. 
Global values are saved to absolute addresses.
See tlib/tlib.s for tlib symbols 

We start at address 0x500. 
See tmacros.inc which "defines" names for some of these addresses.
Addresses ending in 0,4,8,c are dword aligned


0x500 dword   address of linear frame buffer.
0x504 byte    ascii keypress
0x505 byte    drive number we are booting from 
0x508 dword   address to jump to when Ctrl+F12 is pressed.
0x50c dword   Software interrupt.s bitmask errors
0x510 dword   
0x514 dword   
0x518 dword 
0x51c dword   the value of the pit counter irq0 
0x520 dword   address of irqhook for mouse LeftButtonDown
0x524 dword   address of irqhook for mouse RightButtonDown
0x528 dword   address of irqhook for mouse MiddleButtonDown
0x52c dword   address of irqhook for paint
0x530 dword   address of irqhook for keypress
0x534 dword   address of irqhook for mousemove
0x538 dword   BytesPerScanLine (BPSL)
0x53c dword   BytesPerScanLine * 600/64 for dbl buffer (BPSL64)
0x540 dword    
0x544 dword   
0x548 dword   
0x54c byte    the ps/2 mouse DeviceID (should be 0x03)
0x54d byte    Bitmask of errors in mouseinit.s 
0x54e byte    byte 1 of 4 of mouse packet
0x54f byte    byte 2 of 4 of mouse packet
0x550 byte    byte 3 of 4 of mouse packet
0x551 byte    byte 4 of 4 of mouse packet
0x554 dword   Mouse-x position
0x558 dword   Mouse-y position
0x55c word    Qty UHCI USB Controllers Found
0x560 word    bus:dev:func number of 1st UHCI controller
0x562 word    bus:dev:func number of 2nd UHCI controller
0x564 word    bus:dev:func number of 3rd UHCI controller
0x566 word    bus:dev:func number of 4th UHCI controller



0x01000000  usb uhci frame list  
******************************
For USB/UHCI transactions we need a list of 1024 dword pointers (0x1000 bytes). The host controller will jump to the next pointer in the list every 1ms to conduction another usb transaction. The FLBASEADD register gets loaded with this value.


0x01005000 qword head qh
*************************
We reserve 2 dwords for our "head qh". All entries in the frame list point to this qh. The first dword is marked "terminate" meaning no horizontal movement. To init a usb vertical/queue transaction, attach the first td of your link list to the second dword of this qh.


0x01100000   video back buffer
*****************************
We put the video back buffer starting here and the number of bytes in the array is equal to 60 * bytesperscanline. On some computers this is 800*600 = 480000 bytes but on other computers which have invisible padding bytes at the end of each scanline, the number will be bigger.
