-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boot: Translate X-codes to C code for basic system initialization
Drop using proprietary X-code interpreter & translate X-codes to C code. This makes it possible to use a southbridge (e.g. MCPX X2) that does not contain such interpreter.
- Loading branch information
Showing
5 changed files
with
306 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
Xcalibur support by Lehner Franz ([email protected]) | ||
*/ | ||
|
||
#include "2bconsts.h" | ||
#include "consts.h" | ||
|
||
#define xcode_peek(val1) .byte 0x2; .long val1 ; .long 0x0 ; | ||
#define xcode_poke(val1,val2) .byte 0x3; .long val1 ; .long val2 ; | ||
|
@@ -45,9 +45,6 @@ | |
|
||
#define xcode_END(val1) .byte 0xEE; .long val1 ; .long 0x0; | ||
|
||
#define SMBUS 0x0000c000 | ||
|
||
|
||
#define SMB_xcode_Write(val1,val2); xcode_outb(SMBUS+8, val1); \ | ||
xcode_outb(SMBUS+6, val2); \ | ||
xcode_outb(SMBUS+2, 0x0000000a); \ | ||
|
@@ -106,7 +103,14 @@ | |
|
||
//The bytecode interpreter begins here | ||
.org 0x80 | ||
#include "Xcodes.h" | ||
|
||
// Note: X-codes are now translated to C code in BootSystemInitialization() | ||
|
||
// overflow trick | ||
xcode_poke(0x00000000, 0xfc1000ea); | ||
xcode_poke(0x00000004, 0x000008ff); | ||
|
||
xcode_END(0x806); | ||
|
||
// Note: never change this from offset 0x1000 .... | ||
// This is the Main Entry point .... | ||
|
@@ -338,31 +342,9 @@ reload_cs: | |
xor %eax, %eax | ||
mov %eax, %fs | ||
mov %eax, %gs | ||
|
||
movl $ 0x1ffff0,%esp | ||
|
||
mov $0x8, %al | ||
mov $0x61, %dx | ||
out %al, %dx | ||
|
||
// Enable IDE and NIC | ||
mov $0x8000088C, %eax | ||
movw $0xcf8, %dx | ||
outl %eax, %dx | ||
movw $0xcfc, %dx | ||
movl $0x40000000, %eax | ||
outl %eax, %dx | ||
|
||
|
||
// CPU Whoami ? sesless ? | ||
mov $0x80000080, %eax | ||
movw $0xcf8, %dx | ||
outl %eax, %dx | ||
movw $0xcfc, %dx | ||
movl $0x100, %eax | ||
outl %eax, %dx | ||
|
||
|
||
movl $0x1ffff0, %esp | ||
|
||
// this can be found in BootResetAction.c | ||
jmp BootStartBiosLoader | ||
jmp BootStartBiosLoader | ||
|
Oops, something went wrong.