⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot.h

📁 从网上下载的一个自己编写的简单的操作系统源代码,对底层了解很有好处的
💻 H
字号:
/*
 * structures and definitions for the int 15, ax=e820 memory map
 * scheme.
 *
 * In a nutshell, arch/i386/boot/setup.S populates a scratch table
 * in the empty_zero_block that contains a list of usable address/size
 * duples.   In arch/i386/kernel/setup.c, this information is
 * transferred into the e820map, and in arch/i386/mm/init.c, that
 * new information is used to mark pages reserved or not.
 *
 */
#ifndef __boot_HEADER
#define __boot_HEADER


//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
//;
//; 定义启动过程参数
//;
//; fsector.s      软驱启动记录,自举到0x90000
//; setup.s        由fsector.s 加载到 0x10000,长2048 字节, 
//;                                      其后是以head.s 开始的内核.
//; kernel/head.s  内核被setup.s 装载到 0x100000 (1M).

#define BOOTSEG 0x07c0
#define INITSEG 0x9000
#define SYSSEG  0x1000	         //; system loaded at 0x10000 (65536).
#define ENDSEG	SYSSEG + 0x8000  //;SYSSIZE, 448k



/*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 *  E820 sruct
 *
 *
 */
#define E820MAP	0x2d0		/* our map */
#define E820MAX	32		/* number of entries in E820MAP */
#define E820NR	0x1e8		/* # entries in E820MAP */

#define E820_RAM	1
#define E820_RESERVED	2
#define E820_ACPI	3 /* usable as RAM once ACPI tables have been read */
#define E820_NVS	4

#define HIGH_MEMORY	(1024*1024)

#pragma pack(1)

struct e820map {
    struct e820entry {
	unsigned long long addr;	/* start of memory segment */
	unsigned long long size;	/* size of memory segment */
	unsigned long type;		/* type of memory segment */
    } map[E820MAX];
	
};


extern struct e820map e820;



/*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 * boot parameter
 *
 */

#define BTPASEG  INITSEG        //;传递给内核的参数覆盖引导记录 

struct boot{
  char   e820nr;
  struct e820map e820;

};
#pragma pack(0)
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -