Page 1 of 3
Totally lost... Help a poor inocent noob!
Posted: Mon Jun 02, 2008 6:08 pm
by SphinCorp
As much as I hate to admit defeat, I am clueless. I looked everywere and Cannot figure how to do this:
-load pmode (got this one now I think)
-implement SFS as the root filesystem
-load my kernel -WAP.SYS- (might have got that, I don't get the tutorial)
And that's just the bootsector... Sigh.
VB.NET was easier.
Posted: Mon Jun 02, 2008 6:15 pm
by lukem95
dont grovel... its not a very attractive feature and will make people less inclined to help you.
1) go check out a thread called "osdev tutorials" or something similar, its recent and has a list of good websites.
2) jamesmolloy.co.uk and brans kernel development are two good starters (but i would advise starting you're own kernel after fiddling with those)
3) consider using GRUB as a bootloader
Posted: Mon Jun 02, 2008 6:20 pm
by suthers
To start pMode you need to set up a gdt (e.g. make the atble than load it using lgdt). Then set the first byte of CR0 to 1 and the do a long jump into 32bit code using you kernel code selector...
Once you've done that you've got protected mode working.
How far have you got?
Jules
Posted: Mon Jun 02, 2008 6:28 pm
by SphinCorp
well, erm... see I'm in exams these days, and with one week to go, I don't have too much spare time, so I'll be brutally honest and say I can't see how to start this off... It seems like the type of thing that gets easier once you get a basic framework going...
Posted: Mon Jun 02, 2008 6:31 pm
by SphinCorp
Grub seems like a bit much for this type of thing...
Posted: Mon Jun 02, 2008 6:36 pm
by SphinCorp
This is my bootcode-ish sort of thing... The result of three tutorials does it make sense?
Code: Select all
[BITS 16]
[ORG 0x7C00] ;GO TO PMODE-ISH SORT OF THING
cli
xor ax, ax
mov ds, ax
lgdt [gdt_desc]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp 08h:clear_pipe
[BITS 32]
clear_pipe:
mov ax, 10h
mov ds, ax
mov ss, ax
mov esp, 090000h
mov byte [ds:0B8000h], 'P'
mov byte [ds:0B8001h], 1Bh
hang:
jmp hang
gdt:
gdt_null:
dd 0
dd 0
gdt_code:
dw 0FFFFh
dw 0
db 0
db 10011010b
db 11001111b
db 0
gdt_data:
dw 0FFFFh
dw 0
db 0
db 10010010b
db 11001111b
db 0
gdt_end:
gdt_desc:
dw gdt_end - gdt - 1
dd gdt
;I ASSUME THE REST GOES HERE?
;MUST CALL KERNEL HERE, I THINK...
times 510-($-$$) db 0
dw 0AA55h
[/code]
Posted: Mon Jun 02, 2008 6:53 pm
by SphinCorp
Seriously? Were do in here do I call my kernel? And how do I implement SFS?
Posted: Mon Jun 02, 2008 7:11 pm
by Pyrofan1
Were do in here do I call my kernel?
Generally after you've setup everything and have entered pmode
And how do I implement SFS?
Implement a ATA driver and then read the SFS documents and figure out how to read all the tables and then files
Re: Totally lost... Help a poor inocent noob!
Posted: Mon Jun 02, 2008 7:16 pm
by Zenith
SphinCorp wrote:As much as I hate to admit defeat, I am clueless. I looked everywere and Cannot figure how to do this:
-load pmode (got this one now I think)
That code is ripped off from the MuOS tutorial. Do you REALLY UNDERSTAND what it does?
Anyway, if you can't handle PMode, you better start reading up. Intel manuals, tutorials, the wiki, Google, etc. You might also want to brush up your x86 Assembly skills. What language will your OS be in?
SphinCorp wrote:
-implement SFS as the root filesystem
Look up the docs, but you're on your own for this one. See
http://www.osdev.org/wiki/SFS - its creator is also a member of these forums.
SphinCorp wrote:
-load my kernel -WAP.SYS- (might have got that, I don't get the tutorial)
For your bootloader, it doesn't have to be a complete implementation - you just need enough code to read the file (WAP.SYS) into memory. Nothing else. (This is assuming you're on a floppy/hard drive in real mode, and so can hopefully fit the code in your bootloader).
For your OS though, you'll want a complete implementation, device drivers for ATA, etc.
However, from what I've read, I'd
STRONGLY ADVISE you to use a bootloader like GRUB instead (though I really don't think supports SFS).
Also, you could load your kernel first,
then set up protected mode.
SphinCorp wrote:VB.NET was easier.
Oh yeah.
Good luck!
Posted: Mon Jun 02, 2008 7:20 pm
by SphinCorp
I wanted to use GRUB with ext3, but all GNU offers is source code, and I'm on windows. And the download link on osdever.net is broken...
Posted: Tue Jun 03, 2008 1:35 am
by JamesM
SphinCorp wrote:I wanted to use GRUB with ext3, but all GNU offers is source code, and I'm on windows. And the download link on osdever.net is broken...
You'll find a floppy image pre-installed with GRUB
here. That's with an ext2 filesystem (there's no point using ext3 on a floppy - who needs journalling on a floppy?!) - there's also one with a FAT filesystem in pedigree's SVN,
here.
Advice on how to use it with grub is given at my personal website,
http://www.jamesmolloy.co.uk/ - I wrote those tutorials and they've helped some others around here I think, so they should be enough for your needs. If not, go google and find some more
Cheers,
James
Posted: Tue Jun 03, 2008 4:24 am
by svdmeer
@SphinCorp:
- Don't use SFS, but FAT12 or FAT16. They are standard, every OS need FAT-support (widely used on memorycards, floppies..) and when you OS grows you can develop your own one. FAT has not much features, just like SFS, but it's widely supported so using it makes more sense.
- Don't switch to protectedmode from a bootsector. You need that 512-bytes to load a bigger part (mostly a loader) of your OS using bios functions.
- I strongly advise you don't use GRUB. You are beginner, you need to learn how to write a simple bootloader. If you can't this, you won't be able to develop an OS. GRUB seems pretty easy, you can skip one part of the development (the bootloader) but at the next part (kernel) you run into problems again. Do yourself a favour and teach yourself how to write a good bootloader. It's better than just reading some GRUB-manpages, it's fun and it's a valuable part of your OS software.
Posted: Tue Jun 03, 2008 4:43 am
by JamesM
- I strongly advise you don't use GRUB. You are beginner, you need to learn how to write a simple bootloader. If you can't this, you won't be able to develop an OS. GRUB seems pretty easy, you can skip one part of the development (the bootloader) but at the next part (kernel) you run into problems again. Do yourself a favour and teach yourself how to write a good bootloader. It's better than just reading some GRUB-manpages, it's fun and it's a valuable part of your OS software.
I personally advise
against writing a bootloader first. Unless you're going to write your kernel in pure ASM anyway the set of skills required is slightly different. In kernel development it's very easy to get away with just one-liner asm statement as and when required.
As an example, I have
never written my own bootloader.
Posted: Tue Jun 03, 2008 4:58 am
by suthers
I personally wrote my own bootloader, but mainly because I don't like using other people's code...
As for:
Code: Select all
;I ASSUME THE REST GOES HERE?
;MUST CALL KERNEL HERE, I THINK...
That shows a fundemental lack of knoledge of program flow...
Do you actually know what the gdt does and/or any actual assembler?
Jules
Posted: Tue Jun 03, 2008 6:07 am
by SphinCorp
no.