Fixed bug that occurred during DEBUG builds
[reactos.git] / freeldr / freeldr / asmcode.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2002 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 0xA0000 /* The 32-bit stack top will be at 9000:FFFF, or 0x9FFFF */
43
44 #define DISKREADBUFFER 0x90000 /* Buffer to store data read in from the disk via the BIOS */
45
46 #define SCREENBUFFER 0x98000 /* The screen contents will be saved here */
47 #define SCREENXCOORD 0x98FA0 /* Address of the byte that contains the current column of the cursor */
48 #define SCREENYCOORD 0x98FA1 /* Address of the byte that contains the current row of the cursor */
49
50 /* Makes "x" a global variable or label */
51 #define EXTERN(x) .global x; x:
52
53
54
55
56 #ifndef ASM
57
58 void enable_a20(void);
59 void stop_floppy(void);
60
61 #endif /* ! ASM */