Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 11th, 2011, 06:28 AM
blackjackk blackjackk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 1 blackjackk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 26 sec
Reputation Power: 0
Exclamation Assembly - Problem reading from disk

Hi ! I`m trying to write an OS, but I already have some problems with the bootloader. I`m trying to load some assembly code from hard disk, that will set protected mode and load kernel, but i don`t think it loads what it should load. After it calls the int 13h and jumps to the address specified it does nothing and doesn`t even return.
I am using vmware virtual machine. Can anyone give me some advice how i can verify what it loads into the memory? I also posted some code. Maybe there is some problem with the coding.
I compiled the asm file with: nasm -f aout -o x.bin x.asm ;gcc -c -o c.o c.c ; ld -T link.ld -o pmk.com x.o c.o ; and wrote it to the third sector (x00000002-x000) with Runtime`s DiskExplorer.

Here`s the code that should load it:

Code:
[BITS 16]
[ORG 0]

jmp start

............

start:
mov ax, 0x7C0
mov ds, ax

mov [bootdrv], dl

............

read:
mov ax, 0x1000
mov es, ax
xor bx, bx

mov ax, 0x0201
mov ch,	0
mov cl,	3
mov dh,	0
mov dl, bootdrv
int 13h

jc read

jmp 1000h:0000h

.............

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Assembly - Problem reading from disk

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap