All pastes #2090183 Raw Edit

Unnamed

public text v1 · immutable
#2090183 ·published 2011-10-15 01:12 UTC
rendered paste body
KrnRebootSystem:
	;lidt [bogus_idt_desc]
	.not_ready:
		in al, 64h
		and al, 2
	jnz .not_ready
	mov al, 0FEh
	out 64h, al
	.halt:
		hlt
	jmp .halt

KrnShutdownSystem:
	;mov eax, cr0
	;and eax, 7FFFFFFEh
	;mov cr0, eax
	cli
	mov ax, 0Fh
	out 70h, al  ;;cmos address register
	
	out 0EDh, ax ;;; for an I/O delay
	
	mov ax, 5
	out 71h, al  ;;cmos memory register

	mov word [467h], (.realmodeexec - 10000h)
	mov word [469h], 1000h
	call KrnRebootSystem
	
	[BITS 16]
	
	.realmodeexec:
	mov ax, 4201h
	int 15h
	
	.halt:
		hlt
	jmp .halt
	
	[BITS 32]