I have a small problem I have been following the following university course (part of it) http://flint.cs.yale.edu/cs422/assignments/1.html and have produced the following code.
Code: Select all
org 0x7c00
format binary
Start: jmp Begin
nop
Begin: xor ax,ax
cli
mov ds,ax
mov ss,ax
mov es,ax
mov sp,0x7c00
sti
push dx
;Set 80x50 text mode
mov ax, 0003h
int 10h ;first set mode 03h
xor bx, bx
mov ax, 1112h
int 10h ;load 8x8 font (we hope that controller has an internal font that we can use)
mov si,Title
call WriteString
;;;Load next sector
mov ah,2 ;;;Function number
mov al,1 ;;;Sectors to read
mov ch,0 ;;;Cylinder number lower 8 bits
mov cl,2 ;;;Bits 7..6 upper cylinder number to make 10 bits,
;;;5..0 starting sector number
mov dl,0x80 ;;;Drive number
mov dh,0 ;;;Starting head number
mov bx,0x7c00+0x0200 ;;;Offset to load sector
int 0x13
jc BootFailure
mov si,Success
call WriteString
jmp $
BootFailure: mov si,BootFailed
call WriteString
;;;Obtain key press
xor ax,ax
int 0x16
;;;Shut down the machine
mov ax,0x5304
xor bx,bx
int 0x15
mov ax,0x5301
int 0x15
mov ax,0x5308
mov bx,1
mov cx,bx
int 0x15
mov ax,0x530d
int 0x15
mov ax,0x530f
int 0x15
mov ax,0x5305
xor bx,bx
mov cx,102
int 0x15
mov ax,0x5307
mov bx,1
mov cx,3
int 0x15
jmp $
;;;Enter with al containing character to display
WriteChar: mov ah,0x0e
mov bh,0x00
mov bl,0x02
int 0x10
ret
;;;Enter with si ptr to string
WriteString: mov al,byte[si]
call WriteChar
inc si
cmp byte[si],0
jne WriteString
ret
Title: db 'OS 0.1',0x0d,0x0a
db 'Starting....',0x0d,0x0a,0x00
SectorLoaded: db 'Sector loaded',0x00
BootFailed: db 'BOOT FAILED, press any key quit.',0x00
times 510-($-Start) db 0
BootSignature: dw 0xAA55
Success: db 'just babble!!!!!',0x00
Any help would be appreciated