Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Dec 30th, 2004, 12:37 PM   #1
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
I've been messing around with trying to make a few trivial programs that can run without an OS, just for the fun of it. I want to make a full-fledged OS sometime, and I'm just trying to get the feel for how things are done. Anyway, I wrote a simple program with NASM under dos that simply echoes back to you whatever you type. I ran it under DOS to test, and it works exactly how I want it to. Once I knew it worked, I wrote a simple program to load my "echo" code when the computer starts up. Now, my loader program definitely works on startup, as I have made it show me a simple message saying that it was loaded. The problem is that it doesn't load my echo program.

Now, I used debug to save my echo program to sector 5 of a floppy disk. This is the command I gave:

-w 100 0 4 1

Just to make sure I also did this:

-w 100 0 5 1
-w 100 0 6 1

I put my bootloader at the first sector, as I was supposed to using the same method. Here's the code in my loader that I'm using to load my code:

mov ax, 0x0201
mov cx, 0x0005
xor dx, dx
mov bx, 0x5000
mov es, bx
mov bx, 0x100
int 0x13
jmp 0x5000:0x100

All that is supposed to do is load the code from the fifth sector of my floppy disk to addred 0x5000:0x100. It's not doing that. I have no idea why. Have I written the jmp command incorrectly? I know for a fact that my code is there in the fifth sector of the floppy, as I checked with debug. Is there something I'm supposed to add in my echo program to allow it to act as a standalone program that I don't need in dos? Perhaps I need to set some segment registers or something? Could anyone help me out with what I'm doing wrong? Thanks for your time and any help I recieve.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC