Bochs 模拟器 -> 从软盘闪烁引导?
Bochs Emulator -> Blinking Booting from Floppy?
我的 Bochs 仿真器/汇编代码有问题,问题如下:
00060739512i[BIOS ] Booting from 0000:7c00
00061082284e[CPU0 ] load_seg_reg(SS): not writable data segment
00061082284e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00061082284e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
00061082284i[CPU0 ] CPU is in protected mode (active)
00061082284i[CPU0 ] CS.mode = 32 bit
00061082284i[CPU0 ] SS.mode = 16 bit
00061082284i[CPU0 ] EFER = 0x00000000
00061082284i[CPU0 ] | EAX=60000008 EBX=00007e00 ECX=00090002 EDX=00000000
00061082284i[CPU0 ] | ESP=00007c00 EBP=00007c00 ESI=000e0000 EDI=0000ffac
00061082284i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf af PF cf
00061082284i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00061082284i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 ffffffff 1 1
00061082284i[CPU0 ] | DS:0008( 0001| 0| 0) 00000000 ffffffff 1 1
00061082284i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | EIP=00007e56 (00007e56)
00061082284i[CPU0 ] | CR0=0x60000011 CR2=0x00000000
00061082284i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00061082284i[CPU0 ] 0x0000000000007e56>> mov ss, ax : 8ED0
00061082284e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
gdt.asm
gdt_start:
dd 0
dd 0
gdt_codedesc:
dw 0xFFFF ; Limit
dw 0x0000 ; Base (low)
db 0x00 ; Base (medium)
db 10011010b ; Flags
db 11001111b ; Flags + Upper Limit
db 0x00 ; Base (high)
gdt_datadesc:
dw 0xFFFF
dw 0x0000
db 0x00
db 10010010b
db 11001111b
db 0x00
gdt_end;
gdt_descriptor:
gdt_size:
dw gdt_end - gdt_start - 1
dd gdt_start
codeseg equ gdt_codedesc - gdt_start
dataseg equ gdt_codedesc - gdt_start
ExtendedProgram.asm(这是主要的“class”(我是 java 开发人员 :))所有事情都发生了,这也控制着 gdt.asm :))
[org 0x7e00]
jmp EnterProtectedMode
%include "gdt.asm"
%include "print.asm"
EnterProtectedMode:
call EnableA20
cli
lgdt [gdt_descriptor]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp codeseg:StartProtectedMode
EnableA20:
in al, 0x92
or al, 2
out 0x92, al
ret
[bits 32]
StartProtectedMode:
mov ax, dataseg
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ebp, 0x90000
mov esp, ebp
mov[0xb8000], byte 'h'
jmp $
times 2048-($-$$) db 0
有人知道如何解决这个问题吗?我正在学习本教程:https://www.youtube.com/watch?v=pXzortxPZR8&list=PLxN4E629pPnKKqYsNVXpmCza8l0Jb6l8-&index=4 感谢您的帮助!
codeseg equ gdt_codedesc - gdt_start
dataseg equ gdt_ -> codedesc 必须是 datadesc - gdt_start
我的 Bochs 仿真器/汇编代码有问题,问题如下:
00060739512i[BIOS ] Booting from 0000:7c00
00061082284e[CPU0 ] load_seg_reg(SS): not writable data segment
00061082284e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00061082284e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
00061082284i[CPU0 ] CPU is in protected mode (active)
00061082284i[CPU0 ] CS.mode = 32 bit
00061082284i[CPU0 ] SS.mode = 16 bit
00061082284i[CPU0 ] EFER = 0x00000000
00061082284i[CPU0 ] | EAX=60000008 EBX=00007e00 ECX=00090002 EDX=00000000
00061082284i[CPU0 ] | ESP=00007c00 EBP=00007c00 ESI=000e0000 EDI=0000ffac
00061082284i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf af PF cf
00061082284i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00061082284i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 ffffffff 1 1
00061082284i[CPU0 ] | DS:0008( 0001| 0| 0) 00000000 ffffffff 1 1
00061082284i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00061082284i[CPU0 ] | EIP=00007e56 (00007e56)
00061082284i[CPU0 ] | CR0=0x60000011 CR2=0x00000000
00061082284i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00061082284i[CPU0 ] 0x0000000000007e56>> mov ss, ax : 8ED0
00061082284e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
gdt.asm
gdt_start:
dd 0
dd 0
gdt_codedesc:
dw 0xFFFF ; Limit
dw 0x0000 ; Base (low)
db 0x00 ; Base (medium)
db 10011010b ; Flags
db 11001111b ; Flags + Upper Limit
db 0x00 ; Base (high)
gdt_datadesc:
dw 0xFFFF
dw 0x0000
db 0x00
db 10010010b
db 11001111b
db 0x00
gdt_end;
gdt_descriptor:
gdt_size:
dw gdt_end - gdt_start - 1
dd gdt_start
codeseg equ gdt_codedesc - gdt_start
dataseg equ gdt_codedesc - gdt_start
ExtendedProgram.asm(这是主要的“class”(我是 java 开发人员 :))所有事情都发生了,这也控制着 gdt.asm :))
[org 0x7e00]
jmp EnterProtectedMode
%include "gdt.asm"
%include "print.asm"
EnterProtectedMode:
call EnableA20
cli
lgdt [gdt_descriptor]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp codeseg:StartProtectedMode
EnableA20:
in al, 0x92
or al, 2
out 0x92, al
ret
[bits 32]
StartProtectedMode:
mov ax, dataseg
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ebp, 0x90000
mov esp, ebp
mov[0xb8000], byte 'h'
jmp $
times 2048-($-$$) db 0
有人知道如何解决这个问题吗?我正在学习本教程:https://www.youtube.com/watch?v=pXzortxPZR8&list=PLxN4E629pPnKKqYsNVXpmCza8l0Jb6l8-&index=4 感谢您的帮助!
codeseg equ gdt_codedesc - gdt_start dataseg equ gdt_ -> codedesc 必须是 datadesc - gdt_start