cosmopolitan/libc/runtime/mman.internal.h
tkchia 116bda997e
[WIP] Get bare metal working outside of an emulator (#609)
You can now run bare metal on bare metal!

* Fix handling of int 0x15 eax = 0xe820 memory map
* Fix some issues in initial page table creation
* hello4.com now works outside emulators
* Ensure area for identity page tables are zeroed first
* Simplify logic for creating page table entries, this partly
  reverts 577c0f6226
* Add degenerate MBR partition entry, to ease testing

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2022-09-15 12:02:28 -07:00

24 lines
965 B
C

#ifndef COSMOPOLITAN_LIBC_RUNTIME_MMAN_H_
#define COSMOPOLITAN_LIBC_RUNTIME_MMAN_H_
#include "libc/runtime/e820.internal.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
struct mman {
int64_t pdp; /* 0x0500 */
int32_t pdpi; /* 0x0508 */
int32_t e820n; /* 0x050c */
struct SmapEntry e820[256]; /* 0x0510 */
char pc_drive_base_table[11]; /* 0x1d10 */
unsigned char pc_drive_type; /* 0x1d1b */
unsigned char pc_drive_last_sector; /* 0x1d1c */
unsigned short pc_drive_last_cylinder; /* 0x1d1d */
unsigned char pc_drives_attached; /* 0x1d1f */
unsigned char pc_drive_last_head; /* 0x1d20 */
unsigned char pc_drive; /* 0x1d21 */
char bad_idt[6]; /* 0x1d22 */
};
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_RUNTIME_MMAN_H_ */