flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Adding Kernel file to Floppy

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
I made a simple OS (My first one). And I am using a floppy drive to test it.
I use
Code:
debug
-n boot.bin
-w 100 0 0 1
    

To write my boot.bin file to the Floppy drive. But then I need to load the kernel which I'll try do by using BIOS function int 13h.

But the question is, how can I write both of the files to the floppy on different sectors because after writing boot.bin to the floppy, I can no longer access it to write the second file.

How did any of you, OS devs, do it ? (Did you use a Floppy)


PS: I want to use the Floppy (No Emulators) and I wan to use int 13h.


Cheers
Post 04 May 2011, 05:02
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
I remember having exactly the same problem!

I came up with several work-arounds, but the best one was to stop using DOS debug. I use David Lindauer's Get Real Debugger (GRDB) available at http://ladsoft.tripod.com/grdb.htm It reads and writes non-DOS disks quite happily. Most of the syntax is the same as Debug, except for direct disk access! GRDB also has many other nice features.

To write your sectors to floppy disk a:

>grdb boot.bin
-> xw a 100 0 1
-> q

>grdb kernel.bin
-> xw a 100 1A 10
or whatever...

a is the disk drive but do NOT put a colon after it in GRDB.

You can also use GRDB to restore your DOS boot sector of course, which Debug will NEVER allow you to do!

_________________
FAMOS - the first memory operating system
Post 04 May 2011, 08:42
View user's profile Send private message Visit poster's website Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos
Maybe something like this:
Code:
setupldr fat12 a:
copy kernel.bin a:\
    


Some years ago I did like you are doing now:
Code:
debug
- N bootcode.bin
- L 7C00
- W 7C00 0 0 1
- Q
copy kernel.bin a:\
    
Post 04 May 2011, 16:32
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
@neville
i still cannot get to write kernel.bin, grdb says error 20C.
and windows reported that a program was trying to access an unknown formatted disk.

btw i'm using XP Home Edition SP3
Post 04 May 2011, 18:00
View user's profile Send private message Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos
Save BPB structure (or rewrite it with same values).
Post 04 May 2011, 18:55
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I use bootprog, the boot.bin lets you load a mz exe with the name kernel32.exe or kernel32.com.
It keeps the BPB and fat intact so you can load you kernel32.exe onto the floppy like any other file, from windows or linux.

http://alexfru.chat.ru/epm.html#bootprog

Bootprog is written with nasm, i have a fasm ver if you want it.
Post 04 May 2011, 20:57
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
Why dont you use a Virtual Machine to test your os?
oracle sun virtualbox, microsoft virtual pc or vmware...

This way, you just need to create your os within a 3 1/4 flopy image.

in vritualpc the size of the disket image should be byte size perfect.
in wmvare could be not exact.
Post 04 May 2011, 20:57
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
well, iam trying to avoid emulators right now.

@DEX4U yes, i'd like to have the fasm version.
Post 04 May 2011, 22:02
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
typedef wrote:
@neville
i still cannot get to write kernel.bin, grdb says error 20C.
and windows reported that a program was trying to access an unknown formatted disk.

btw i'm using XP Home Edition SP3
Oh yes I was working in a pure DOS environment back then. DOS 7.1 = Win98 DOS if I remember correctly. Have you tried running GRDB as administrator? WinXP will be the problem now.

_________________
FAMOS - the first memory operating system
Post 04 May 2011, 22:43
View user's profile Send private message Visit poster's website Reply with quote
egos



Joined: 10 Feb 2009
Posts: 144
egos
Enko wrote:
This way, you just need to create your os within a 3 1/4 flopy image.

Is it something new? I know 3.5 and 5.25 floppies only Smile

_________________
If you have seen bad English in my words, tell me what's wrong, please.
Post 04 May 2011, 22:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
egos wrote:
Is it something new? I know 3.5 and 5.25 floppies only Smile
Nope, it is not new. It is very old.
Post 04 May 2011, 22:51
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
neville wrote:
typedef wrote:
@neville
i still cannot get to write kernel.bin, grdb says error 20C.
and windows reported that a program was trying to access an unknown formatted disk.

btw i'm using XP Home Edition SP3
Have you tried running GRDB as administrator? WinXP will be the problem now.

that means in safe mode. because XP home edition allows admin account only in safe mod. let me try it
Post 04 May 2011, 22:52
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
typedef wrote:
that means in safe mode. because XP home edition allows admin account only in safe mod. let me try it
You don't need safe mode to run as administrator. Use the "run as" dialog and you can open any program as an administrator.
Post 04 May 2011, 22:59
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
nope, still getting the same error 20C
Post 04 May 2011, 23:11
View user's profile Send private message Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
typedef wrote:
nope, still getting the same error 20C
Have you tried right-clicking on Command Prompt and selecting "Run as administrator", then running GRDB from there?
If still no good, maybe the latest version of GRDB is different to the one I used. First get another DOS-formatted FAT12 floppy disk and see if you can write your boot sector with GRDB, using the syntax I gave you before.
I don't recall errors like C20. GRDB used to give four-digit error codes.

_________________
FAMOS - the first memory operating system
Post 05 May 2011, 00:01
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
yes the error is 020C
Post 05 May 2011, 01:42
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
windows xp home edition does not allow administrator account to run in normal mode.

that is it's behavior. you can go to M$ blogs or forums they'll tell you the same thing.
it is the nature of it's design.

anyways, this is even harder than making a mouse driver.
Post 05 May 2011, 02:53
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
oh..i have an idea,,,i'll use two floppy disks.......lol
Post 05 May 2011, 02:55
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
typedef wrote:
oh..i have an idea,,,i'll use two floppy disks.......lol

There exist some tools to write flopy disk images on a disket using xp.
I used one to create a win98 recovery disk on a xp pc. I downloaded the tool, and the floppy image.
It was a long time ago, so I don't remember.

But perhaps you should search for a tool to write the entire flopy image. By the way, with this method you could use an emulator with the image too Twisted Evil
Post 05 May 2011, 13:12
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
Try this one:

http://www.winimage.com/download.htm


edited:

WinImage is shareware. You may evaluate it for a period of 30 days. After 30 days, you need to register it if you intend to continue using WinImage.


now its wshareware Sad





----------------------------------
http://www.bootdisk.com/bootdisk.htm
in this site, are some windows recovery disk instalations utilities.

http://www.msu-hb.de/download/boot98se.exe
this utility writes the image into the floppy, but ther's a problem, the image is a exe resource.
if you use winrar, it can extract the flopy image from the program. So i think it should be possible using some resource editor like reshack or similar to REPLACE the original image, with one you need.
Post 05 May 2011, 13:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.