Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
BITS 16
jmp 07c0h
msg db "WELCOME TO G1 OS",0
msg1 db "Press Enter to Continue",0
start:
mov ax,cs
mov ds,ax
mov es,ax
;prompt
call prompt
;setting the cursor
mov dh,9
mov dl,30
call set_cursor
;welcome msg
xor ax,ax
mov si,msg
call print
mov dh,12
mov dl,45
call set_cursor
mov si,msg1
call print
call wait_enter
prompt:
mov ah,00h
mov al,10h
int 10h
mov ah,0Bh
mov bh,00h
mov bl,0Ah
int 10h
ret
set_cursor:
mov ah,02
mov bh,00
int 10h
ret
print:
mov ah,0Eh
mov bh,00h
mov bl,07
lodsb
cmp al,0
je end
int 10h
jmp print
end:
ret
wait_enter:
mov ah,10h
int 16h
cmp ah,1ch
je end1
jmp wait_enter
end1:
ret
hang:
jmp hang
times 510-($-$$) db 0
dw 0AA55h
...............................................................i compiled and got d bin file..........now i want to boot it from pendrive.........i hav copied the bin file to pendrive..and changed d boot order to boot from os frst.bt i am not able to get the welcome msg.......plz help me..................i have tried from cd also bt unable to view d welcome msg...........
1. Read the forum rules first. (Particularly the section on asking smart questions)
2. A period is not a space, nor should a period (or a space) be abused such.
3. You will find the answer on the wiki, I'd assume that you have not read it until sufficient evidence is provided to the contrary.
4. (I'm not sure that the rules say this, but) Code dumps are frowed upon, espectially if it's an entire file.
Before testing it on real hardware make sure it works by testing it in a testing environment like I tested it on virtualbox. Also like thepowersgang said please don't post your entire code. But since you did I edited the part I thought was wrong and found another part that is resulting in a green screen in the "start:" section. I changed the beginning to where instead of the jmp 07c0h I put "call start" and managed to get something up. Also you probably need to change where the welcome message like in "mainloop:" or start and have the message print where the current message is in the code. And here are some pictures of what I managed to get without dramatically changing the code. The first one is what happens on boot, the other one is when you push enter
I found an online translator and set it to "stupid to English translation". Here's the result:
"Thanks feare56.
Please can you tell me how to test a .bin file in virtual box? Should I convert boot.bin to an iso file and then boot it from USB?"
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.