mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:42:44 +00:00 
			
		
		
		
	 9da62f52a1
			
		
	
	
		9da62f52a1
		
	
	
	
	
		
			
			This makes it possible to run Serenity with more than 64 MB of RAM. Because each physical page is represented by a PhysicalPage object, and such objects are allocated using kmalloc_eternal(), more RAM means more pressure on kmalloc_eternal(), so we're gonna need a better strategy for this. But for now, let's just celebrate that we can use the 128 MB of RAM we've been telling QEMU to run with. :^)
		
			
				
	
	
		
			111 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			111 lines
		
	
	
	
		
			2.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <AK/Types.h>
 | |
| 
 | |
| struct multiboot_aout_symbol_table {
 | |
|     dword tabsize;
 | |
|     dword strsize;
 | |
|     dword addr;
 | |
|     dword reserved;
 | |
| };
 | |
| typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
 | |
| 
 | |
| struct multiboot_elf_section_header_table {
 | |
|     dword num;
 | |
|     dword size;
 | |
|     dword addr;
 | |
|     dword shndx;
 | |
| };
 | |
| typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
 | |
| 
 | |
| #define MULTIBOOT_MEMORY_AVAILABLE 1
 | |
| #define MULTIBOOT_MEMORY_RESERVED 2
 | |
| #define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
 | |
| #define MULTIBOOT_MEMORY_NVS 4
 | |
| #define MULTIBOOT_MEMORY_BADRAM 5
 | |
| 
 | |
| struct multiboot_mmap_entry {
 | |
|     dword size;
 | |
|     qword addr;
 | |
|     qword len;
 | |
|     dword type;
 | |
| } __attribute__((packed));
 | |
| typedef struct multiboot_mmap_entry multiboot_memory_map_t;
 | |
| 
 | |
| struct multiboot_info {
 | |
|     // Multiboot info version number.
 | |
|     dword flags;
 | |
| 
 | |
|     // Available memory from BIOS.
 | |
|     dword mem_lower;
 | |
|     dword mem_upper;
 | |
| 
 | |
|     // "root" partition.
 | |
|     dword boot_device;
 | |
| 
 | |
|     // Kernel command line.
 | |
|     dword cmdline;
 | |
| 
 | |
|     // Boot-Module list.
 | |
|     dword mods_count;
 | |
|     dword mods_addr;
 | |
| 
 | |
|     union {
 | |
|         multiboot_aout_symbol_table_t aout_sym;
 | |
|         multiboot_elf_section_header_table_t elf_sec;
 | |
|     } u;
 | |
| 
 | |
|     // Memory Mapping buffer.
 | |
|     dword mmap_length;
 | |
|     dword mmap_addr;
 | |
| 
 | |
|     // Drive Info buffer.
 | |
|     dword drives_length;
 | |
|     dword drives_addr;
 | |
| 
 | |
|     // ROM configuration table.
 | |
|     dword config_table;
 | |
| 
 | |
|     // Boot Loader Name.
 | |
|     dword boot_loader_name;
 | |
| 
 | |
|     // APM table.
 | |
|     dword apm_table;
 | |
| 
 | |
|     // Video.
 | |
|     dword vbe_control_info;
 | |
|     dword vbe_mode_info;
 | |
|     word vbe_mode;
 | |
|     word vbe_interface_seg;
 | |
|     word vbe_interface_off;
 | |
|     word vbe_interface_len;
 | |
| 
 | |
|     qword framebuffer_addr;
 | |
|     dword framebuffer_pitch;
 | |
|     dword framebuffer_width;
 | |
|     dword framebuffer_height;
 | |
|     byte framebuffer_bpp;
 | |
| #define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
 | |
| #define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
 | |
| #define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
 | |
|     byte framebuffer_type;
 | |
|     union {
 | |
|         struct
 | |
|         {
 | |
|             dword framebuffer_palette_addr;
 | |
|             word framebuffer_palette_num_colors;
 | |
|         };
 | |
|         struct
 | |
|         {
 | |
|             byte framebuffer_red_field_position;
 | |
|             byte framebuffer_red_mask_size;
 | |
|             byte framebuffer_green_field_position;
 | |
|             byte framebuffer_green_mask_size;
 | |
|             byte framebuffer_blue_field_position;
 | |
|             byte framebuffer_blue_mask_size;
 | |
|         };
 | |
|     };
 | |
| };
 | |
| typedef struct multiboot_info multiboot_info_t;
 | |
| 
 | |
| extern "C" multiboot_info_t* multiboot_info_ptr;
 |