Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 233 → Rev 235

/SPARTAN/trunk/arch/ia32/src/ia32.c
60,7 → 60,7
i8042_init(); /* a20 bit */
i8259_init(); /* PIC */
i8254_init(); /* hard clock */
 
trap_register(VECTOR_SYSCALL, syscall);
#ifdef __SMP__
/SPARTAN/trunk/arch/ia32/src/boot/boot.S
42,20 → 42,21
#
kernel_image_start:
cli
xorw %ax,%ax
movw %ax,%ds
movw %ax,%ss # initialize stack segment register
movl $0x7c00,%esp # initialize stack pointer
xorw %ax, %ax
movw %ax, %ds
movw %ax, %ss # initialize stack segment register
movl $0x7c00, %esp # initialize stack pointer
call memmap_arch_init
lgdt gdtr # initialize Global Descriptor Table register
movl %cr0,%eax
orl $0x1,%eax
movl %eax,%cr0 # switch to protected mode
jmpl $8,$meeting_point
 
movl %cr0, %eax
orl $0x1, %eax
movl %eax, %cr0 # switch to protected mode
jmpl $8, $boot_image_start
.code32
.align 4
multiboot_header:
62,27 → 63,50
.long MULTIBOOT_HEADER_MAGIC
.long MULTIBOOT_HEADER_FLAGS
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) # checksum
.long multiboot_header
.long unmapped_ktext_start
.long multiboot_header + BOOT_OFFSET
.long unmapped_ktext_start + BOOT_OFFSET
.long 0
.long 0
.long multiboot_image_start
.long multiboot_image_start + BOOT_OFFSET
boot_image_start:
movw $16, %ax
movw %ax, %es
movw %ax, %gs
movw %ax, %fs
movw %ax, %ds # kernel data + stack
movw %ax, %ss
call map_kernel # map kernel and turn paging on
movb $0xd1, %al # enable A20 using the keyboard controller
outb %al, $0x64
movb $0xdf, %al
outb %al, $0x60
movl $0x8000, %esi
movl $0x8000 + BOOT_OFFSET, %edi
movl $_hardcoded_kernel_size, %ecx
cld
rep movsb
jmp protected
multiboot_image_start:
movl $0x7c00, %esp # initialize stack pointer
lgdt gdtr
 
meeting_point:
movw $16,%ax
movw %ax,%es
movw %ax,%gs
movw %ax,%fs
movw %ax,%ds # kernel data + stack
movw %ax,%ss
 
movw $16, %ax
movw %ax, %es
movw %ax, %gs
movw %ax, %fs
movw %ax, %ds # kernel data + stack
movw %ax, %ss
call map_kernel # map kernel and turn paging on
 
protected:
call main_bsp # never returns
 
cli
/SPARTAN/trunk/arch/ia32/src/mm/frame.c
44,6 → 44,9
frame_region_not_free(0xa0000,0xff000);
frame_region_not_free(0xfec00000,0xffffffff);
/* This is a nasty hack, which should be fixed soon */
frame_region_not_free(0x9000, 0xa000);
for (i=e820counter;i>0;i--) {
if (e820table[i-1].type!=MEMMAP_MEMORY_AVAILABLE) {
frame_region_not_free(e820table[i-1].base_address,e820table[i-1].size);
/SPARTAN/trunk/arch/ia32/src/mm/page.c
37,6 → 37,7
#include <synch/spinlock.h>
#include <debug.h>
#include <memstr.h>
#include <print.h>
 
__address bootstrap_dba;
 
50,7 → 51,7
memsetb(dba, PAGE_SIZE, 0);
 
bootstrap_dba = dba;
 
/*
* Identity mapping for all frames.
* PA2KA(identity) mapping for all frames.
/SPARTAN/trunk/arch/ia32/src/drivers/i8042.c
36,15 → 36,10
 
/*
* i8042 processor driver.
* Its very essential function is enabling the A20.
*/
 
void i8042_init(void)
{
/* A20: deadly if not enabled */
outb(0x64,0xd1);
outb(0x60,0xdf);
trap_register(VECTOR_KBD, i8042_interrupt);
}