2010-09-07 21:04:31 +00:00
|
|
|
/*
|
|
|
|
* QEMU Boot sector to launch a preloaded Linux kernel
|
|
|
|
* Copyright (c) 2004 Fabrice Bellard
|
|
|
|
*/
|
|
|
|
|
2012-09-12 00:46:52 -07:00
|
|
|
// MetalSVM reuses the same routine to launch its preloaded kernel
|
|
|
|
|
2010-09-07 21:04:31 +00:00
|
|
|
#define LOAD_SEG 0x9000
|
|
|
|
// define CONFIG_MCEMU_DEBUG 1
|
|
|
|
.code16
|
|
|
|
.text
|
|
|
|
.globl _start
|
|
|
|
|
|
|
|
.org 0x0000
|
|
|
|
.ascii "MetalSVM Boot sector"
|
|
|
|
|
|
|
|
_realstart:
|
|
|
|
#ifdef CONFIG_MCEMU_DEBUG
|
|
|
|
movl $27, %eax
|
|
|
|
movw $0xff8, %dx
|
|
|
|
outl %eax, %dx
|
|
|
|
movl $0x0010, %eax
|
|
|
|
movw $0xffc, %dx
|
|
|
|
outl %eax, %dx
|
|
|
|
#endif
|
|
|
|
cli
|
|
|
|
cld
|
|
|
|
mov $LOAD_SEG, %ax
|
|
|
|
mov %ax, %ds
|
|
|
|
mov %ax, %es
|
|
|
|
mov %ax, %fs
|
|
|
|
mov %ax, %gs
|
|
|
|
mov %ax, %ss
|
|
|
|
mov $0x8ffe, %sp
|
|
|
|
ljmp $LOAD_SEG + 0x20, $0
|
|
|
|
|
|
|
|
.org 0x0ff0
|
|
|
|
_start:
|
|
|
|
jmp _realstart
|
|
|
|
_end:
|
2012-09-12 00:46:52 -07:00
|
|
|
.fill 4096 - $, 1, 0
|