Skip to main content
GameDev.net gamedev.net
🔒 Locked

BootLoader

Started by Larry91 Sep 4, 2010 at 7:10 AM 1 replies 800+ views
Original Post
Larry91
Larry91
Hello everybody!
I want to create an ASM bootloader that load my c++ OS that is located on the disk! Will you give me a simple tutorial, please?
I prefer to write my OS in Microsoft VC++.

I try this:
;------------------------------------------------------------.286							   ; CPU type;------------------------------------------------------------.model TINY						   ; memory of model;---------------------- EXTERNS -----------------------------extrn				_BootMain:near	   ; prototype of C func;------------------------------------------------------------;------------------------------------------------------------   .code   org				07c00h		   ; for BootSectormain:				jmp short start	   ; go to main				nop						;----------------------- CODE SEGMENT -----------------------start:	        cli        mov ax,cs               ; Setup segment registers        mov ds,ax               ; Make DS correct        mov es,ax               ; Make ES correct        mov ss,ax               ; Make SS correct                mov bp,7c00h        mov sp,7c00h            ; Setup a stack        sti                                ; start the program         call           _BootMain        ret                END main                ; End of program
Larry91
Larry91
I solved! It's working!
How can I load from bootloader a file (.com) from the HDD?
Dr Yap
Dr Yap
Try the osdev specific websites such as:

osdev.org
osdever.net

You need to create a kernel that can do i/o processes with the HDD and also use the file system (most likely NTFS). The websites above have tutorials and links to help you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.