Fix running on bochs by forcing x86 pentium codegen
This commit is contained in:
@@ -79,7 +79,7 @@ static void pmm_init1(void) {
|
||||
}
|
||||
|
||||
void bootmain(void *mbootptr) {
|
||||
multiboot_set((struct multiboot *)VIRT(mbootptr));
|
||||
multiboot_set((struct multiboot *)((uptr_t)mbootptr + VIRT_BASE));
|
||||
|
||||
cpu_init();
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ SECTIONS {
|
||||
. = 0x00100000;
|
||||
|
||||
.multiboot ALIGN(4K): {
|
||||
*(.multiboot)
|
||||
KEEP(*(.multiboot))
|
||||
}
|
||||
|
||||
.boot ALIGN(4K) : {
|
||||
*(.boot)
|
||||
KEEP(*(.boot))
|
||||
}
|
||||
|
||||
. += VIRT_BASE;
|
||||
@@ -64,5 +64,11 @@ SECTIONS {
|
||||
*(.bss)
|
||||
}
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame)
|
||||
*(.comment)
|
||||
*(.note.gnu.build-id)
|
||||
}
|
||||
|
||||
__kernel_end = .;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ static void tss_init(void) {
|
||||
tss.fs = 0x10 | 0x3;
|
||||
tss.fs = 0x10 | 0x3;
|
||||
tss.ss = 0x10 | 0x3;
|
||||
tss.iomap = sizeof(tss);
|
||||
|
||||
tss_flush();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <sync/spinlock.h>
|
||||
|
||||
#define VIRT_BASE 0xC0000000
|
||||
#define VIRT(x) (((uptr_t)(x)) + VIRT_BASE)
|
||||
|
||||
#define PAGE_SIZE 0x1000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user