Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Release 1.0
[palacios.git] / geekos / src / geekos / defs.asm
1 ; Definitions for use in GeekOS boot code
2 ; Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
3 ; $Revision: 1.12 $
4
5 ; This is free software.  You are permitted to use,
6 ; redistribute, and modify it as specified in the file "COPYING".
7
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:
10
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
15
16 %ifndef DEFS_ASM
17 %define DEFS_ASM
18
19 ;Zheng 08/01/2008
20 SYSSEG equ 0x1000
21 COMMAND_LINE_SIZE equ 1024
22
23 SETUPSECTS      equ 4            ; /* default nr of setup-sectors */
24 SYSSIZE         equ 0x7f00       ; /* system size: # of 16-byte clicks */
25 ROOT_DEV        equ 0            ; /* ROOT_DEV is now written by "build" */
26 SWAP_DEV        equ 0            ; /* SWAP_DEV is now written by "build" */
27
28 ;VM_KERNEL_TARGET       equ 0x100000
29         
30 ; BIOS loads the boot sector at offset 0 in this segment
31 BOOTSEG equ 0x07C0
32  
33 ; We'll move the boot sector up to higher memory.
34 ; Note that the "ISA hole" begins at segment 0xA000 == 640K.
35 INITSEG equ 0x9000
36
37 ; Put the setup code here, just after the boot sector.
38 SETUPSEG equ 0x9020
39
40 ; Load our "Kernel" at this segment, which starts at 64K.
41 ; The number of sectors in the kernel, NUM_KERN_SECTORS,
42 ; will be passed on the command line.
43 KERNSEG equ 0x1000
44
45 ;; Load Segment for moving guest kernel to extended memory
46 ;; Note that this segment must not colide with where the VMM kernel
47 ;; is initially loaded.  At this point, we just place it in the last
48 ;; 64K of RAM available before the ISA hole and hope for the best
49  VMSEG equ 0x8000
50
51 ; Size of PFAT boot record.
52 ; Keep up to date with <geekos/pfat.h>.
53 PFAT_BOOT_RECORD_SIZE equ 28
54
55 ; Offset of BIOS signature word in boot sector.
56 BIOS_SIGNATURE_OFFSET equ 510
57
58 ; Offset of PFAT boot record in boot sector.
59 PFAT_BOOT_RECORD_OFFSET equ BIOS_SIGNATURE_OFFSET - PFAT_BOOT_RECORD_SIZE
60
61 ; Video memory segment
62 VIDSEG equ 0xb800
63
64 ; The following information is correct for a 1.44M floppy.
65 ; Yes, I'm hard coding this.
66 ;SECTORS_PER_TRACK equ 18       
67 HEADS equ 2
68 CYLINDERS equ 80
69
70 ; 8259A PIC initialization codes.
71 ; Source: Linux bootsect.S, and Intel 8259A datasheet
72
73 ; The most important reason why we reprogram the PICs is to
74 ; route the hardware interrupts through vectors *above*
75 ; those reserved by Intel.  The BIOS (for historical reasons :-)
76 ; routes them such that they conflict with internal processor-generated
77 ; interrupts.
78
79 ICW1 equ 0x11           ; ICW1 - ICW4 needed, cascade mode, interval=8,
80                         ;   edge triggered. (I think interval is irrelevant
81                         ;   for x86.)
82 ICW2_MASTER equ 0x20    ; put IRQs 0-7 at 0x20 (above Intel reserved ints)
83 ICW2_SLAVE equ 0x28     ; put IRQs 8-15 at 0x28
84 ICW3_MASTER equ 0x04    ; IR2 connected to slave
85 ICW3_SLAVE equ 0x02     ; slave has id 2
86 ICW4 equ 0x01           ; 8086 mode, no auto-EOI, non-buffered mode,
87                         ;   not special fully nested mode
88
89 ; Kernel code and data segment selectors.
90 ; Keep these up to date with defs.h.
91 KERNEL_CS equ 1<<3      ; kernel code segment is GDT entry 1
92 KERNEL_DS equ 2<<3      ; kernel data segment is GDT entry 2
93
94 ; Pages for context object and stack for initial kernel thread -
95 ; the one we construct for Main().  Keep these up to date with defs.h.
96 ; We put them at 1MB, for no particular reason.
97         ;;  Moved to just after where the VM will go
98 KERN_THREAD_OBJ equ 4096
99 KERN_STACK equ KERN_THREAD_OBJ + 4096
100
101 %endif