?
Solved

Boot Sector

Posted on 2004-11-24
3
Medium Priority
?
383 Views
Last Modified: 2008-03-06
I'm using asm112 to write a program to floppy boot sector.

Here's the code

        mov     ax,07c0
        mov     ds,ax
        xor     bx,bx
        mov     ah,0e
        mov     si,offset(string)
@1      lodsb
        cmp     al,00
        je      @2
        int     10
        jmps    @1
@2      xor     ah,ah
        int     16
        callf   ffff:0000

string  db      'Sorry, this disk is not bootable.' 0a 0d
        db      'Please insert another disk and press any key to reboot.' 0a 0d 00


THIS works fine. However i want to create it myself in DEBUG. Heres what i'm doing

f 0000 ffff 00; fill address range in debug.
r cx: 01ff;
w 0 0 0 1; write blank address range to floppy boot sec

a0000; start assembling at offset 0000
 
   mov ax,07c0
   mov ds,ax
   mov es,ax
   mov cs,ax
   mov ss,ax
  db 'Hello World $'
   mov ah,09
   mov dx,offset for db
   int 21
   int 20
finished

rcx: 01ff
w 0 0 0 1

then i clear memory again and reload the floppy boot sector to make sure it
is written.

However when i start the computer with the floppy i get nothing.

Any suggestions. I have tried various things and even used jmp from first address to 003e. and started my code there but no joy still.

PS. I'd offer more points if only i had them.
0
Comment
Question by:Newt6398
3 Comments
 
LVL 7

Expert Comment

by:aib_42
ID: 12672730
I'm not familiar with your method of writing to the floppy boot sector. Are you sure it is doing its job properly?
0
 
LVL 1

Author Comment

by:Newt6398
ID: 12673440
Not 100% put i do recall doing it in this way a year or so ago and it worked fine. I'm just missing something crutial. But i cannot remember.
0
 
LVL 11

Accepted Solution

by:
pratap_r earned 300 total points
ID: 12687341
Nett6398, theres nothing wrong with writing to the floppy that way.. one point, int 21h is a dos function call and wont be present at boot time ;-) may you should use int 10h

Have Fun!
Pratap
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Tech giants such as Amazon and Google have sold Alexa and Echo to such an extent that they have become household names. And soon they are expected to be used by commoners in their homes, ordering takeout, picking out a song, answering trivia questio…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question