Looking for driver

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
os_dreamer

Looking for driver

Post by os_dreamer »

I'm writing an OS (for intel 386+) and I need a driver
for FAT12 file system. I found the DRYWELL-OS and there
was a boot loader which loads a OSLOAD.SYS but it is in real mode,
the easyest way would be to make a pass to pmode in
OSLOAD.SYS, but wat to do after, I would need it to load
an other program (this time writen in c) and again I need
a FAT12 driver.

So I need a FAT DRIVER

Also if someone know where can I find a boot loader like the
one of DRYWELL but before loading any file would pass to
pmode

P.S. Do you know which file system use a floppy disk formated
with Windows 98/95 ?
J. Weeks

RE:Looking for driver

Post by J. Weeks »

>On 2002-02-11 19:19:19, os_dreamer wrote:
>I'm writing an OS (for intel 386+) and I need a driver
>for FAT12 file system. I found the DRYWELL-OS and there
>was a boot loader which loads a OSLOAD.SYS but it is in real mode,
>the easyest way would be to make a pass to pmode in
>OSLOAD.SYS,

Not necessarily. There's often a hell of a lot of
stuff you have to do to enter pmode with your desired
system specs (ie, the IDT, GDT, LDT, CR3, etc) which
is, obviously, better left to a second stage boot loader,
cuz... well, it'll fit! There's no way you're
going to fit all that in 512 bytes. Trust me, I
tried :)

>but wat to do after, I would need it to load
>an other program (this time writen in c) and again I need
>a FAT12 driver.

Yep. That's how it's usually done, sir.

>So I need a FAT DRIVER

You can't just ask for a fat driver, dude. For one,
we're all writting new operating systems here, eh?
Our "driver model" is obviously not going to be the
same as yours (unless we specially designed it as
such... or some really strange twist of fate), so
any driver that we could write for fat, would be
completely non-functional in your OS.

What you _need_ is some source, which you've blatantly
just said you've found in the drywell OS. Why not
adapt that source? Assuming you know how, and assuming
the author permits you to do so (is it GPL?)

>Also if someone know where can I find a boot loader like the
>one of DRYWELL but before loading any file would pass to
>pmode

My old boot sector is around the net all over the
place (search for polyos). I'm pretty sure it
jumped to pmode before loading a second stage
boot loader. Keep in mind, that's an old version...
I later moved the pmode code to a second stage
boot loader, simply because it's easier and makes
more sense. I'd reccomend you do the same.

>P.S. Do you know which file system use a floppy disk formated
>with Windows 98/95 ?

Uhm... VFat!? Which is basically FAT with some
long filename extentions (ps: floppies are FAT12,
of course... anything more would be kinda stupid)

Jeff
Robert

RE:Looking for driver

Post by Robert »

>Not necessarily. There's often a hell of a lot of
>stuff you have to do to enter pmode with your desired
>system specs (ie, the IDT, GDT, LDT, CR3, etc) which
>is, obviously, better left to a second stage boot loader,
>cuz... well, it'll fit! There's no way you're
>going to fit all that in 512 bytes. Trust me, I
>tried :)

I enter pmode without any IDT (of course with interrupts
disabled), and with a 2-segment GDT (one code and
one data segment), then I load the ELF image to
high memory, and jump to the kernel entry point.
THEN you can set up paging, processes, and all other
pmode features you want.

/Robert
OS_Dreamer

RE:Looking for driver

Post by OS_Dreamer »

There is nothing on the DRYWELL page about anyum licence

I have the code of the os loader, I will modyfy it :
First if will load the OSINIT.SYS (in real-mode, it will do all the setup),
the OSINIT will do RET, and once again the boot loader will
load load a file (this time my kernel) KERNEL.SYS but before
jumping to my kernel it will pass to pmode, I think I will
need to add 10-20 lines of assembler, I hope it will be <512 bytes


Do you think it will work ?
Guest

RE:Looking for driver

Post by Guest »

>On 2002-02-12 05:37:49, OS_Dreamer wrote:
>There is nothing on the DRYWELL page about anyum licence
>
>I have the code of the os loader, I will modyfy it :
> First if will load the OSINIT.SYS (in real-mode, it will do all the setup),
> the OSINIT will do RET, and once again the boot loader will
> load load a file (this time my kernel) KERNEL.SYS but before
> jumping to my kernel it will pass to pmode, I think I will
> need to add 10-20 lines of assembler, I hope it will be <512 bytes
>
>
>Do you think it will work ?

No !!! I modified the asm file (don't work, it's my error) without changing
to pmode, I have only 13 bytes to check if the pmode is supported
and change to it, not enoth I think
J. Weeks

RE:Looking for driver

Post by J. Weeks »

>I enter pmode without any IDT (of course with interrupts
>disabled), and with a 2-segment GDT (one code and
>one data segment), then I load the ELF image to
>high memory, and jump to the kernel entry point.
>THEN you can set up paging, processes, and all other
>pmode features you want.

Oh, yeah, indeed. I didn't mean to say it was
impossible. I've done the same ('cept I have an
extra segment for the stack as well). I'm just
saying that a lot of time, I don't think its very
feasable.

With my boot-loader, I added in 386+ detection code,
some spiffy messages, and a bunch of movements (so
that I would sitll be able to use real interrupts,
and have mine at 0x0). By the time I'd done all
this I was well over 512 bytes, so I had to move
that code elsewhere.

Plus, it makes sense (to me anyway) to include
that secondary boot-up step just incase you need
to add other code to the boot-up process.

Jeff
Post Reply