1 ; Definitions for use in GeekOS boot code
2 ; Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
5 ; This is free software. You are permitted to use,
6 ; redistribute, and modify it as specified in the file "COPYING".
8 ; A lot of this code is adapted from Kernel Toolkit 0.2
9 ; and Linux version 2.2.x, so the following copyrights apply:
11 ; Copyright (C) 1991, 1992 Linus Torvalds
12 ; modified by Drew Eckhardt
13 ; modified by Bruce Evans (bde)
14 ; adapted for Kernel Toolkit by Luigi Sgro
19 ; BIOS loads the boot sector at offset 0 in this segment
22 ; We'll move the boot sector up to higher memory.
23 ; Note that the "ISA hole" begins at segment 0xA000 == 640K.
26 ; Put the setup code here, just after the boot sector.
29 ; Load our "Kernel" at this segment, which starts at 64K.
30 ; The number of sectors in the kernel, NUM_KERN_SECTORS,
31 ; will be passed on the command line.
35 ; Size of PFAT boot record.
36 ; Keep up to date with <geekos/pfat.h>.
37 PFAT_BOOT_RECORD_SIZE equ 28
39 ; Offset of BIOS signature word in boot sector.
40 BIOS_SIGNATURE_OFFSET equ 510
42 ; Offset of PFAT boot record in boot sector.
43 PFAT_BOOT_RECORD_OFFSET equ BIOS_SIGNATURE_OFFSET - PFAT_BOOT_RECORD_SIZE
45 ; Video memory segment
48 ; The following information is correct for a 1.44M floppy.
49 ; Yes, I'm hard coding this.
50 SECTORS_PER_TRACK equ 18
54 ; 8259A PIC initialization codes.
55 ; Source: Linux bootsect.S, and Intel 8259A datasheet
57 ; The most important reason why we reprogram the PICs is to
58 ; route the hardware interrupts through vectors *above*
59 ; those reserved by Intel. The BIOS (for historical reasons :-)
60 ; routes them such that they conflict with internal processor-generated
63 ICW1 equ 0x11 ; ICW1 - ICW4 needed, cascade mode, interval=8,
64 ; edge triggered. (I think interval is irrelevant
66 ICW2_MASTER equ 0x20 ; put IRQs 0-7 at 0x20 (above Intel reserved ints)
67 ICW2_SLAVE equ 0x28 ; put IRQs 8-15 at 0x28
68 ICW3_MASTER equ 0x04 ; IR2 connected to slave
69 ICW3_SLAVE equ 0x02 ; slave has id 2
70 ICW4 equ 0x01 ; 8086 mode, no auto-EOI, non-buffered mode,
71 ; not special fully nested mode
73 ; Kernel code and data segment selectors.
74 ; Keep these up to date with defs.h.
75 KERNEL_CS equ 1<<3 ; kernel code segment is GDT entry 1
76 KERNEL_DS equ 2<<3 ; kernel data segment is GDT entry 2
78 ; Pages for context object and stack for initial kernel thread -
79 ; the one we construct for Main(). Keep these up to date with defs.h.
80 ; We put them at 1MB, for no particular reason.
81 KERN_THREAD_OBJ equ 4096
82 KERN_STACK equ KERN_THREAD_OBJ + 4096