Created
June 18, 2011 15:58
-
-
Save nathanpc/1033222 to your computer and use it in GitHub Desktop.
Booting a Kernel In The Middle Of a Floppy
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
org 7C00h | |
mov ax, 1000h | |
mov ss, ax | |
mov sp, 0 ; Points to the top of the stack | |
mov ax, cs | |
mov ds, ax | |
mov ah, 02h ; Read sub function | |
mov al, 1 ; Number of sectors to read | |
mov ch, 0 ; Cylinder | |
mov cl, 2 ; Sector | |
mov dh, 0 ; Head | |
mov dl, 0 ; Drive (00h = A:) | |
mov bx, 0800h ; ES:BX Points to the memory location | |
mov es, bx ; Where the data will be written | |
mov bx, 0 ; 0800:0000h (ES = 0800h, BX = 0000h) | |
int 13h ; Floppy interrupt | |
; Turn off the floppy drive | |
mov dx,3F2h | |
mov al,0 | |
out dx,al |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment