Separated multiboot kernel loader and reactos kernel loader so that support for other...
[reactos.git] / freeldr / freeldr / asmcode.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1999, 2000 Brian Palmer <brianp@sginet.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20
21 /* Defines needed for switching between real and protected mode */
22 #define NULL_DESC 0x00 /* NULL descriptor */
23 #define PMODE_CS 0x08 /* PMode code selector, base 0 limit 4g */
24 #define PMODE_DS 0x10 /* PMode data selector, base 0 limit 4g */
25 #define RMODE_CS 0x18 /* RMode code selector, base 0 limit 64k */
26 #define RMODE_DS 0x20 /* RMode data selector, base 0 limit 64k */
27
28 #define KERNEL_BASE 0xC0000000
29 //#define USER_CS 0x08
30 //#define USER_DS 0x10
31 //#define KERNEL_CS 0x20
32 //#define KERNEL_DS 0x28
33 #define KERNEL_CS 0x08
34 #define KERNEL_DS 0x10
35
36 #define CR0_PE_SET 0x00000001 /* OR this value with CR0 to enable pmode */
37 #define CR0_PE_CLR 0xFFFFFFFE /* AND this value with CR0 to disable pmode */
38
39 #define NR_TASKS 128 /* Space reserved in the GDT for TSS descriptors */
40
41 #define STACK16ADDR 0x7000 /* The 16-bit stack top will be at 0000:7000 */
42 #define STACK32ADDR 0x60000 /* The 32-bit stack top will be at 6000:0000, or 0x60000 */
43
44 #define FILESYSADDR 0x80000 /* The filesystem data address will be at 8000:0000, or 0x80000 */
45
46 #define FATCLUSTERBUF 0x60000 /* The fat filesystem's cluster buffer */
47
48 #define SCREENBUFFER 0x68000 /* The screen contents will be saved here */
49 #define FREELDRINIADDR 0x6C000 /* The freeldr.ini load address will be at 6000:C000, or 0x6C000 */
50
51 #define SCRATCHSEG 0x7000 /* The 512-byte fixed scratch area will be at 7000:0000, or 0x70000 */
52 #define SCRATCHOFF 0x0000 /* The 512-byte fixed scratch area will be at 7000:0000, or 0x70000 */
53 #define SCRATCHAREA 0x70000 /* The 512-byte fixed scratch area will be at 7000:0000, or 0x70000 */
54
55 /* Makes "x" a global variable or label */
56 #define EXTERN(x) .global x; x:
57
58
59
60
61 #ifndef ASM
62
63 void enable_a20(void);
64
65 #endif /* ! ASM */