before or after the jump?Do you change your IDT ?
i set it up in my kernel, yes.
before or after the jump?Do you change your IDT ?
Code: Select all
;---------- _shutdown.asm ----------
[BITS 32]
[global __shutdown]
[global __shutdownend]
__shutdown:
incbin 'shutdown.bin'
__shutdownend:
;------------------ shutdown.asm ------------
[BITS 32]
cli ; disable interrupts
;------ clear the PG bit ------
mov eax, cr0
xor eax, 0x80000000
mov cr0, eax
;------ clear the paging cache ------
xor eax, eax
mov cr3, eax
;------ clear the PE bit ------
mov eax, cr0
xor eax, 1
mov cr0, eax
;------ do a far jump to a 16-bit code segment ------
jmp word 0x00:real_mode
[BITS 16]
real_mode:
xor ax,ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ax, 0x9000
mov ss, ax
mov esp, 0x8000
hlt
jmp $-1
i know, but I want to get this working first, then make the other things (call in 0x15)well, if it's just for a "hlt" loop, you don't need to switch to realmode at all !
not realy, directly after real_mode stands only hlt in the old code, but i try that what you say. (so the very first thing you should do there is reloading realmode values to every data segment )does the previously submitted bochs panic come from that very code ?
i call shutdownare you calling "shutdown" or "shutdownend" ?
see above (shutdown.asm), the code mark includes two files.what does the piece of code located in "shutdown.bin" exactly do
Code: Select all
;; --- new shutdown.asm ---
[BITS 32]
[ORG 0]
call tell_location
adjust:
add word [jump+1],dx
cli ; disable interrupts
;------ clear the PG bit ------
mov eax, cr0
and eax, 0x7FFFFFFF
mov cr0, eax
;------ clear the PE bit ------
mov eax, cr0
and al,0xFE
mov cr0, eax
;------ do a far jump to a 16-bit code segment ------
jump:
jmp word 0x00:real_mode
; the run-time address of 'adjust' is now on the top of the stack [esp]
; we just retrieve it and substract the offset of adjust in the file to get
; the run-time address of the file itself.
tell_location:
mov edx,[esp]
sub edx,adjust
ret
[BITS 16]
real_mode:
xor ax,ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ax, 0x9000
mov ss, ax
mov esp, 0x8000
hlt
jmp $-1
whats a tarball?can you send me a tarball of your bochs test image+config ?