2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
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 3 of the License, or
8 (at your option) any later version.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #define IVT_ADDRESS 0x00000
27 #define IVT_SIZE 0x00200
29 #define BIOSCODE_ADDRESS 0xC0000
30 #define BIOSCODE_SIZE 0x40000
34 #define PHYS_MEMORY memphys_memory ///< phys memory available
35 #define PHYS_PAGES (PHYS_MEMORY/PAGE_SIZE) ///< phys pages available
37 #define BIOSDATA_ADDRESS 0 ///< virt/phys address of BIOS data
38 #define BIOSDATA_SIZE (1*MBYTES) ///< virt/phys address of BIOS data
40 #define KERNELCODE_ADDRESS (BIOSDATA_ADDRESS+BIOSDATA_SIZE) ///< virt/phys address of kernel code
41 #define KERNELCODE_SIZE (2*MBYTES) ///< virt/phys size of kernel code
42 /// @todo We don't need 2MB for kernel code, but for loaded programs.
44 #define STACKDATA_ADDRESS (KERNELCODE_ADDRESS+KERNELCODE_SIZE) ///< virt address of stack data
45 #define STACKDATA_SIZE (4*MBYTES) ///< virt size of stack data
47 #define KERNELDATA_ADDRESS (STACKDATA_ADDRESS+STACKDATA_SIZE) ///< virt address of kernel data
48 #define KERNELDATA_SIZE (1*GBYTES-KERNELDATA_ADDRESS) ///< virt size of kernel data
50 #define USERDATA_ADDRESS (1*GBYTES) ///< virt address of user data
51 #define USERDATA_SIZE (3068*MBYTES-4*KBYTES) ///< virt size of user data
53 #define KERNELPD_ADDRESS ((unsigned int)PAGEUP(KERNELCODE_ADDRESS+KERNELCODE_SIZE)) ///< phys address of Kernel PD (and PTs)
54 #define KERNELPD_SIZE (3*PAGE_SIZE) ///< phys size of Kernel PD (and PTs)
56 #define FREEPHYS_ADDRESS (KERNELPD_ADDRESS+KERNELPD_SIZE) ///< phys address of free (phys) pages
57 #define FREEPHYS_SIZE (PHYS_MEMORY-FREEPHYS_ADDRESS) ///< phys size of free (phys) pages
59 #define BUFPAGE_ADDRESS (4092*MBYTES-4*KBYTES) ///< Buffer page for writing/reading physical memory
60 #define PAGETABLES_ADDRESS (4092*MBYTES) ///< loaded Pagetables
61 #define PAGEDIR_ADDRESS (4*GBYTES-4*KBYTES) ///< loaded Pagedir