3 * Copyright (C) 1999, 2000, 2001 Brian Palmer <brianp@sginet.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "multiboot.h"
28 * Here we assume the kernel is loaded at 1mb
29 * This boots the kernel
36 /* Save cursor position */
37 movw $3,%ax //! Reset video mode
45 movw $0x1112,%ax // Use 8x8 font
48 movw $0x1200,%ax // Use alternate print screen
51 movb $1,%ah // Define cursor (scan lines 6 to 7)
59 movb $6,%ah // Scroll active page up
60 movb $0x32,%al // Clear 25 lines
61 movw $0,%cx // Upper left of scroll
62 movw $0x314F,%dx // Lower right of scroll
63 movb $(1*0x10+1),%bh // Use normal attribute on blanked line
83 // Should never get here
89 * After you have setup the _mb_header and _mb_info structures
90 * then call this routine to transfer control to the kernel.
91 * This routine must be entered in 16-bit mode.
99 * Setup various variables
104 addl %eax,kernel_gdtbase
107 * Load the absolute address of the multiboot information structure
117 * Enter pmode and clear prefetch queue
125 * NOTE: This must be position independant (no references to
126 * non absolute variables)
130 * Initalize segment registers
146 * Load the multiboot magic value into eax
148 movl $0x2badb002,%eax
151 * Jump to start of 32 bit code at 0xc0000000 + 0x1000
158 //ljmpl $KERNEL_CS,$(0x0200000+0x1000)
159 //ljmpl $KERNEL_CS,(_mb_entry_addr)
160 //ljmpl $KERNEL_CS,$(KERNEL_BASE+0x1000)
163 .p2align 2 /* force 4-byte alignment */
165 .word 0 // Zero descriptor
170 .word 0xffff // Kernel code descriptor
172 .word 0x9a00 // base 0h limit 4gb
175 .word 0xffff // Kernel data descriptor
177 .word 0x9200 // base 0h limit 4gb
181 .word (3*8)-1 /* Limit */
183 .long kernel_gdt /* Base Address */
188 .long 0 // unsigned long magic;
190 .long 0 // unsigned long flags;
192 .long 0 // unsigned long checksum;
194 .long 0 // unsigned long header_addr;
196 .long 0 // unsigned long load_addr;
198 .long 0 // unsigned long load_end_addr;
200 .long 0 // unsigned long bss_end_addr;
202 .long 0 // unsigned long entry_addr;
205 // Boot information structure
211 _multiboot_mem_lower:
213 _multiboot_mem_upper:
215 _multiboot_boot_device:
219 _multiboot_mods_count:
221 _multiboot_mods_addr:
227 _multiboot_mmap_length:
229 _multiboot_mmap_addr:
231 _multiboot_drives_count:
233 _multiboot_drives_addr:
235 _multiboot_config_table:
237 _multiboot_boot_loader_name:
239 _multiboot_apm_table:
242 EXTERN(_multiboot_modules)
243 .rept (64 * /*multiboot_module_size*/ 16)
246 EXTERN(_multiboot_module_strings)
251 EXTERN(_multiboot_memory_map_descriptor_size)
254 EXTERN(_multiboot_memory_map)
255 .rept (64 * /*sizeof(memory_map_t)*/24)
259 EXTERN(_multiboot_kernel_cmdline)