News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Not able to jmp to kernel at sect2

Started by zak100, November 15, 2009, 03:23:52 PM

Previous topic - Next topic

sinsi

You should be able to write to a floppy sector-by-sector (if you can use the win32 api).

The floppy boot sector for DOS 5+ (pre-win2000) searches the entire root directory for a file called io.sys, loads it (at 0070:0000 I think) and jumps to it.
heh, you should look at a win7 boot sector (looks for a bios bitlocker api). A CD boot sector without emulation (2000 et al) is interesting too...
Light travels faster than sound, that's why some people seem bright until you hear them.

FORTRANS

Hi Dave,

Quote from: dedndave on November 25, 2009, 03:50:58 PM
the problem we are encountering is simple
newer OS's are not letting us write to the FAT area
older OS's allow it
it is an access permission issue

   Actually, with my experiments in MS-DOS 6.2x and Windows 2000,
it is not really an access issue.  One sector write can go anywhere.
But if you (I, we) screw up either the BPB or the FAT, Win2k gets
very unhappy.  If it is the BPB then you cannot access any of the
diskette.

   The original boot sector you posted had a one byte error that
killed the BPB.  Win2K then says that it is corrupt and write protected.
Writing the boot load to the first FAT sector killed the FAT marker byte.
So, while Win2k still allowed you to write to the diskette a second time
to write a boot sector, any check of it before that said it was corrupt.
(CHKDSK, DISKEDIT, or my utility variant.)

   Possibly a nit, but access per say to a properly formatted diskette
does not seem to be a problem.  It is just that Win2k gets really
miffed with a non-standard diskette.  And then you have no access
at all.

   DOS could care less apparently.  Though it reports errors just fine
when asked.  So it looked like it barfed on some occasions.

YMMV,

Steve N.

zak100

Hi,
Thanks all of you for working on my prob. I have tried Steve's solution again but still the prob persists. I have yet checked any of the other options provided by other friends. However I am able to run the nasm program. If any body is interested i can email him. The attachment icon is not visible, may be not enabled. This proves Steve's point of view that OS doesnt put any restriction on writing on the sectors.
I would try to work on ther sol. soon.

Zulfi.

FORTRANS

Hi,

   Attached is the modified code Dave posed, and the resulting
binaries.  If you could perform a sanity check Dave?  Zulfi, you
can see if this matches what you were using.

Regards,

Steve N.

dedndave

looks good, Steve
i wish i had a floppy drive to play with - lol
i am almost finished with my other project - it is coming along nicely

when i am done with that, i want to...
1) write a boot sector that finds our "IO.SYS" (or whatever we name it) anywhere on the disk
2) write a program that writes the boot sector (selectable to skip this step)
   the boot sector code will be part of the program
   and writes an external "IO.SYS" type file to the disk (also selectable to skip this step)
   the last part may not be necessary if the bootstrap works the way i want
   you can just copy the file over to the floppy

once we get that all up and running, Zulfi can start playing with the really hard part - the IO.SYS program - lol

zak100

Hi all,
This solution has worked. I would be comparing this code with mine to find out whats the prob. I applied sinsi's suggestion and even changed the BPB as said by Steve but things were not working. I would now check how this is working. I have just copied the binaries and not yet compiled the whole.

Zulfi.