Minor fixes to Linux and Chainloading protocols

This commit is contained in:
mintsuki 2020-09-26 00:28:36 +02:00
parent 2483902b88
commit 5457af4202
3 changed files with 8 additions and 3 deletions

Binary file not shown.

View File

@ -10,7 +10,8 @@
__attribute__((section(".realmode"), used)) __attribute__((section(".realmode"), used))
static void spinup(uint8_t drive) { static void spinup(uint8_t drive) {
asm volatile ( asm volatile (
// Jump to real mode "cld\n\t"
"jmp 0x08:1f\n\t" "jmp 0x08:1f\n\t"
"1: .code16\n\t" "1: .code16\n\t"
"mov ax, 0x10\n\t" "mov ax, 0x10\n\t"
@ -30,9 +31,13 @@ static void spinup(uint8_t drive) {
"mov fs, ax\n\t" "mov fs, ax\n\t"
"mov gs, ax\n\t" "mov gs, ax\n\t"
"mov ss, ax\n\t" "mov ss, ax\n\t"
"sti\n\t"
"push 0\n\t" "push 0\n\t"
"push 0x7c00\n\t" "push 0x7c00\n\t"
"retf\n\t" "retf\n\t"
".code32\n\t" ".code32\n\t"
: :
: "d" (drive) : "d" (drive)

View File

@ -15,7 +15,6 @@
__attribute__((section(".realmode"), used)) __attribute__((section(".realmode"), used))
static void spinup(uint16_t real_mode_code_seg, uint16_t kernel_entry_seg) { static void spinup(uint16_t real_mode_code_seg, uint16_t kernel_entry_seg) {
asm volatile ( asm volatile (
"cli\n\t"
"cld\n\t" "cld\n\t"
"jmp 0x08:1f\n\t" "jmp 0x08:1f\n\t"
@ -36,8 +35,9 @@ static void spinup(uint16_t real_mode_code_seg, uint16_t kernel_entry_seg) {
"mov fs, bx\n\t" "mov fs, bx\n\t"
"mov gs, bx\n\t" "mov gs, bx\n\t"
"mov ss, bx\n\t" "mov ss, bx\n\t"
"mov esp, 0xfdf0\n\t"
"mov sp, 0xfdf0\n\t" "sti\n\t"
"push cx\n\t" "push cx\n\t"
"push 0\n\t" "push 0\n\t"