Import backup from 2004-07-09
This commit is contained in:
1 parent
f3fe4ef3b8
commit
0729754659
76 files changed
+470
-7676
No files matched your search
@@ -0,0 +1,2 @@
|
||||
clean:
|
||||
- rm *~
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
#ifndef __HOS_KERNEL_H__
|
||||
#define __HOS_KERNEL_H__ __HOS_KERNEL_H__
|
||||
|
||||
#include "multiboot.h"
|
||||
|
||||
#define LINK_ADDRESS 0xC0000000
|
||||
|
||||
/* returns true to callee if we should jump to a real mode module */
|
||||
int k_mbsave(mb_info_t *mbinfo, unsigned int mb_magic);
|
||||
|
||||
void k_init();
|
||||
|
||||
void isr();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
#ifndef __HOS_MODULE_H__
|
||||
#define __HOS_MODULE_H__ __HOS_MODULE_H__
|
||||
|
||||
#define MOD_REAL_MODE 1
|
||||
#define MOD_KERNEL 2
|
||||
|
||||
typedef struct {
|
||||
unsigned int mod_magic; // "HOSM" = 0x484F534D
|
||||
unsigned int mod_type; // module type
|
||||
void (*init) (); // address of void initialization function
|
||||
unsigned int reserved;
|
||||
} hos_module_header_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
|
||||
#ifndef __HOS_MULTIBOOT_H__
|
||||
#define __HOS_MULTIBOOT_H__ __HOS_MULTIBOOT_H__
|
||||
|
||||
/* The magic number for the Multiboot header. */
|
||||
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
|
||||
#define MB_HEADER_ALIGN_MODULES 0x01
|
||||
#define MB_HEADER_MEM_INFO 0x02
|
||||
#define MB_HEADER_VIDEO_INFO 0x04
|
||||
#define MB_HEADER_KLUDGE_OFFSETS 0x10000
|
||||
|
||||
|
||||
/* The magic number passed by a Multiboot-compliant boot loader. */
|
||||
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
|
||||
|
||||
#define MB_BOOTLOADER_MEM_INFO 0x01
|
||||
#define MB_BOOTLOADER_BOOT_DEVICE 0x02
|
||||
#define MB_BOOTLOADER_COMMAND_LINE 0x04
|
||||
#define MB_BOOTLOADER_MODS 0x08
|
||||
#define MB_BOOTLOADER_AOUT 0x10
|
||||
#define MB_BOOTLOADER_ELF 0x20
|
||||
#define MB_BOOTLOADER_MMAP 0x40
|
||||
#define MB_BOOTLOADER_DRIVES 0x80
|
||||
#define MB_BOOTLOADER_CONFIG 0x0100
|
||||
#define MB_BOOTLOADER_APM 0x0200
|
||||
#define MB_BOOTLOADER_GRAPHICS 0x0400
|
||||
|
||||
|
||||
#define MB_DRIVE_MODE_CHS 0
|
||||
#define MB_DRIVE_MODE_LBA 1
|
||||
|
||||
|
||||
/* The Multiboot header. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int magic;
|
||||
unsigned int flags;
|
||||
unsigned int checksum;
|
||||
unsigned int header_addr;
|
||||
unsigned int load_addr;
|
||||
unsigned int load_end_addr;
|
||||
unsigned int bss_end_addr;
|
||||
unsigned int entry_addr;
|
||||
} mb_header_t;
|
||||
|
||||
/* The symbol table for a.out. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int tabsize;
|
||||
unsigned int strsize;
|
||||
unsigned int addr;
|
||||
unsigned int reserved;
|
||||
} mb_aout_symbol_table_t;
|
||||
|
||||
/* The section header table for ELF. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int num;
|
||||
unsigned int size;
|
||||
unsigned int addr;
|
||||
unsigned int shndx;
|
||||
} mb_elf_section_header_table_t;
|
||||
|
||||
/* The Multiboot information. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int flags;
|
||||
unsigned int mem_lower;
|
||||
unsigned int mem_upper;
|
||||
unsigned int boot_device;
|
||||
unsigned int cmdline;
|
||||
unsigned int mods_count;
|
||||
unsigned int mods_addr;
|
||||
union
|
||||
{
|
||||
mb_aout_symbol_table_t aout_sym;
|
||||
mb_elf_section_header_table_t elf_sec;
|
||||
};
|
||||
unsigned int mmap_length;
|
||||
unsigned int mmap_addr;
|
||||
unsigned int drives_length;
|
||||
unsigned int drives_addr;
|
||||
unsigned int config_table;
|
||||
unsigned int bootloader_name;
|
||||
unsigned int apm_table;
|
||||
|
||||
unsigned int vbe_control_info;
|
||||
unsigned int vbe_mode_info;
|
||||
unsigned short vbe_mode;
|
||||
unsigned short vbe_interface_seg;
|
||||
unsigned short vbe_interface_off;
|
||||
unsigned short vbe_interface_len;
|
||||
} mb_info_t;
|
||||
|
||||
/* The module structure. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int mod_start;
|
||||
unsigned int mod_end;
|
||||
unsigned int string;
|
||||
unsigned int reserved;
|
||||
} mb_module_t;
|
||||
|
||||
/* The memory map. Be careful that the offset 0 is base_addr_low, not size. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; //offset -4
|
||||
unsigned int base_addr_low; //offset 0
|
||||
unsigned int base_addr_high;
|
||||
unsigned int length_low;
|
||||
unsigned int length_high;
|
||||
unsigned int type;
|
||||
} mb_mmap_t;
|
||||
|
||||
/* The drive structure */
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
unsigned char drive_number;
|
||||
unsigned char drive_mode;
|
||||
unsigned char drive_cylinders;
|
||||
unsigned char drive_heads;
|
||||
unsigned char drive_sectors;
|
||||
unsigned short drive_ports[1];
|
||||
} mb_drive_t;
|
||||
|
||||
/* APM table structure */
|
||||
typedef struct
|
||||
{
|
||||
unsigned short version;
|
||||
unsigned short cseg;
|
||||
unsigned int offset;
|
||||
unsigned short cseg_16;
|
||||
unsigned short dseg;
|
||||
unsigned short flags;
|
||||
unsigned short cseg_len;
|
||||
unsigned short cseg_16_len;
|
||||
unsigned short dseg_len;
|
||||
} mb_apm_t;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user