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

📄 multiboot.h

📁 一个微型操作系统源码
💻 H
字号:
/* * OSV * Copyright (C) 2002 Ciprian DOSOFTEI <rocksoul@mail.com> * All rights reserved. *  * http://backster.free.fr/osv * * This file is part of the OSV project. OSV is free software, also known as * "open source"; you can redistribute it and/or modify it under the terms  * of the GNU General Public License (GPL), version 2, as published by the Free * Software Foundation (FSF). To explore alternate licensing terms, contact  * the author at rocksoul@mail.com or +40740649907. *  * OSV is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE.  See the GPL for more details.  You should have * received a copy of the GPL along with OSV; see the file COPYING.  If * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA. */#ifndef INCMULTIBOOT#define INCMULTIBOOT#include <types.h>#include <exit.h>#define MULTIBOOT_MEMORY	(1L<<0)#define MULTIBOOT_BOOT_DEVICE	(1L<<1)#define MULTIBOOT_CMDLINE	(1L<<2)#define MULTIBOOT_MODS		(1L<<3)/* #define MULTIBOOT_AOUT_SYMS	(1L<<4) */#define MULTIBOOT_ELF_SHDR	(1L<<5)#define MULTIBOOT_MEM_MAP	(1L<<6)typedef struct mb_module{  /* physical start and end addresses of the module data itself.  */    ulong start;    ulong end;  /* arbitrary ASCII-Z string associated with the module.  */    char *string;  /* boot loader must set to 0; OS must ignore.  */    ulong reserved;} __attribute__ ((packed)) mb_module_t;typedef struct mem_map{    ulong size;    ulong base_addr_low;    ulong base_addr_high;    ulong len_low;    ulong len_high;    ulong type;} __attribute__ ((packed)) mem_map_t;/* The symbol table for a.out.  */typedef struct aout_symbol_table{    unsigned long tabsize;    unsigned long strsize;    unsigned long addr;    unsigned long reserved;} aout_symbol_table_t;/* The section header table for ELF.  */typedef struct elf_section_header_table{    unsigned long num;    unsigned long size;    unsigned long addr;    unsigned long shndx;} elf_section_header_table_t;typedef struct multibootInfo{  /* these flags indicate which parts of the multiboot_info are valid;   * see below for the actual flag bit definitions.  */    ulong flags;  /* lower/upper memory installed in the machine.   * valid only if MULTIBOOT_MEMORY is set in flags word above.  */    ulong mem_lower;    ulong mem_upper;  /* BIOS disk device the kernel was loaded from.   * Valid only if MULTIBOOT_BOOT_DEVICE is set in flags word above.  */    ulong boot_device;  /* command-line for the OS kernel: a null-terminated ASCII string.   * valid only if MULTIBOOT_CMDLINE is set in flags word above.  */    char *cmd_line;  /* list of boot modules loaded with the kernel.   * valid only if MULTIBOOT_MODS is set in flags word above.  */    ulong mod_count;    mb_module_t *modules;  /* Info about the kernel binary */    union {	aout_symbol_table_t aout_sym;	elf_section_header_table_t elf_sec;    } u;  /* memory map -- int 0x15 BIOS call (e820) */    ulong mmap_length;    mem_map_t *mmap_addr;} __attribute__ ((packed)) mb_info_t;ulong get_available_memory(mb_info_t *bootInfo);ulong get_used_memory(mb_info_t *bootInfo);void show_memory_map(mb_info_t *bootInfo);void show_modules(mb_info_t *bootInfo);#endif

⌨️ 快捷键说明

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