flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Boot an image from DOS - need help...

Author
Thread Post new topic Reply to topic
Daemon



Joined: 08 Jul 2003
Posts: 15
Daemon
Hi, I need some help in booting a raw image from DOS mode.
What I mean, I try to make simple DOS COM/EXE executable file which should read a raw CDROM bootsector at 0000:7C00h and run it. But when I run it, it hangs!
As I see, there's many interrupts & other mess which DOS should restore when booting to int 19h, but it doesn't!

Code:
        mov     ax, cs
        mov     ds, ax
        mov     dx, new_int
        mov     ax, 2519h
        int     21h  ;  set new int 19h handler

        mov     dx, fname
        mov     ax, 3d00h
        int     21h  ;  open file
        jc      error
        mov     [fhandle], ax

        mov     bx, ax
        mov     cx, 0800h
        mov     ax, cs
        mov     ds, ax
        mov     dx, 0200h
        mov     ah, 3fh
        int     21h  ;  read file to CS:0200h
        jc      error

        int     19h  ;  reboot to new handler

error:
        mov     ax, 0900h
        mov     dx, error1
        int     21h
        mov     ax, 01h
        int     21h

new_int:
        cli
        mov     ax, cs
        mov     ds, ax
        xor     ax, ax
        mov     es, ax
        mov     si, 0200h
        mov     di, 07c00h
        mov     cx, 0800h
        rep     movsb

        mov     dx, 00e0h
        jmp     far 0000h:7c00h


noerror db 'File open success!$'
error1 db 'Error opening file!$'
fname db 'no_emul.BIN',0
fhandle dw ?
    


This piece of code says "Press any key to boot from cd.." and when the key is pressed, hangzZz...

P.S. I try to boot a win installation from DOS. Could it be better loading SETUPLDR.BIN than original no_emul_boot.img from XP CD ?
Post 07 Mar 2005, 16:59
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Why do you not just burn a floppy image on a CD, as a bootable.
Most burn software lets you do this, my iso for my OS does it this way.
http://falconrybells.co.uk/
Post 07 Mar 2005, 17:12
View user's profile Send private message Reply with quote
Daemon



Joined: 08 Jul 2003
Posts: 15
Daemon
Dex4u, U don't understood. I _have_ a DOS-bootable floppy as a boot-image for CD. What I want is to run WinXP setup from dos command prompt not as winnt.exe but as if it were boot from CD itself... (winnt.exe copies setup files to HDD then restarts, while setupldr.bin runs w/o this mess...)
Post 07 Mar 2005, 17:22
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Sorry, i mis understud Wink.
Post 07 Mar 2005, 22:02
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.