problems in tutorial 4

If you are new to development, plan on spending some time here before visiting the other forums.

Moderator: Moderators

problems in tutorial 4

Postby digvijay » Sat Sep 03, 2011 7:31 am

i have made following changes to my previous code to display "welcome to my os!'.
however it still doesn't works

*******************************************************

org 0x7c00 ;we are loaded at 07c00
bits 16 ;16 bits real mode

start: jmp loader

msg db "WELCOME TO MY OS!",0




print:

lodsb
or al,al
jz done
mov ah,0x0E ;request display
mov bl,0x1E ;foreground color
int 0x10 ;call interrupt service
jmp print

done:
ret

loader:

xor ax,ax
mov ds,ax
mov es,ax


mov si,msg
call print


cli
jmp $ ;infinite loop


times 510-($-$$) db 0

dw 0xAA55

*******************************************************

it just displays

booting from floppy....

nothing else

also plz tell why to make ds register 0
what if its made to point to 7c00

whats wrong in this code,really tired doing same thing
digvijay
 
Posts: 4
Joined: Mon Aug 29, 2011 5:55 am

Re: problems in tutorial 4

Postby utsav_popli » Sun Nov 24, 2013 4:59 am

I am not sure, but as far as i found about the bootloader.
bios loads the bootcode at CS:0, ip 07c0
So to make ds and cs point to same are we make ds and other segments 0
utsav_popli
 
Posts: 7
Joined: Sat Nov 28, 2009 7:39 am
Location: San Jose, CA


Return to Beginners

Who is online

Users browsing this forum: No registered users and 1 guest

cron