Totally lost... Help a poor inocent noob!

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.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

OK - why are you doing this? Is it for a school/university project or 'just for fun'?

If it's the latter I strongly suggest you get and read the Intel Software Developper's Manuals, which are free and can be ordered from their web. If it's the former, I suggest you ask for more guidence from your lecturers and make use of your library.

Here are some hints:

Code: Select all

hang: 
        jmp hang
Follow your program flow step-by-step. What do you think this label and instruction do? Why, then, do you think that program execution gets as far as:

Code: Select all

;I ASSUME THE REST GOES HERE? 
;MUST CALL KERNEL HERE, I THINK... 
Second, the GDT. In real mode, you have 16 bit Segment:Offset memory addressing. To get the linear memory address, you add (segment * 0x10) + offset. In PMode, there is no need for this. You have 32 bit offsetts, but still need to load valid segment offsets from your GDT. Once this is done, you can all but ignore the GDT (assuming flat 4GiB segments). You can read more about the GDT in the Intel manuals (which are also available as PDF's, by the way).

Lastly, you really need to know a lot more about the memory environment you are working with before you can load your kernel. In real mode, you can load your kernel somewhere below 1MiB using BIOS interrupts (Google Ralph Brown's Interrupt List and look up Int 0x13). The problem with this, is you need to know what is already in the PC's memory. For example, your real mode IVT is from 0x0000:0x0000 to 0x0000:0x0400 in memory. You don't want to overwrite that. BIOS and video data may be from somewhere around 0x9C00:0000 to 0xFFFF:000F, and you don't want to overwrite that either. You don't have such constraints in PMode with paging, but then you have to write a disk driver for every disk type you could possibly want.

Oh - or you can use GRUB.

In other words, you have a lot of background reading left to do still before you even start coding.

Cheers,
Adam
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

He isn't doing it for either, he is doing it to make a 'product' for his company, he made a thread in Announcements if you want to read about it.
Jules
svdmeer
Member
Member
Posts: 87
Joined: Tue May 06, 2008 9:32 am
Location: The Netherlands

Post by svdmeer »

http://www.osdev.org/phpBB2/viewtopic.p ... highlight=

This is so lame...

No flame intended, but some people really have to question about wheter it makes sense to write an OS (or even try it)..
There are too much people with some VB experience thinking they can make an operatingsystem.
svdmeer
Member
Member
Posts: 87
Joined: Tue May 06, 2008 9:32 am
Location: The Netherlands

Post by svdmeer »

suthers wrote: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
SphinCorp wrote:no.
Posted: Sun Jun 01, 2008 9:49 pm, in http://www.osdev.org/phpBB2/viewtopic.p ... highlight=
SphinCorp wrote:At least you told me why you think I'm stupid... :cry:

By the way: I do know what I'm doing!!! I know a fair amount of Assembly Language and C, I understand any tutorials completely and have done small things relating to OS developments here and there. This is a project to basically assemble everything together. I need help, because I have never designed anything this big before, and can't possibly do it all alone. At least give me hints, tips, links, samples OR SOMETHING before you you decide that I'm a worthless freak!!!!!
I rest my case.

(People are very helpful in this forum but please learn the basics first and know what you are doing)
User avatar
ollie123
Member
Member
Posts: 26
Joined: Tue May 27, 2008 2:42 am
Location: Great Yarmouth, Norfolk, United Kingdom

Post by ollie123 »

NEW TO OPERATING SYSTEM DEVELOPMENT
Good OS Development Tutorials: http://www.brokenthorn.com/Resources/OSDevIndex.html
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

suthers wrote:He isn't doing it for either, he is doing it to make a 'product' for his company, he made a thread in Announcements
Ah, thanks - missed that one. Someone attempting to write an OS (semi-)professionally, who obviously knows very little about a) assembly and b) the architectute the OS is for is quite worrying...

Cheers,
Adam
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

svdmeer wrote:- Don't use SFS
Do use it :)
Seriously, telling people to do A while B is perfectly valid is a bad thing. Yes FAT owns SFS in some respects, but SFS totally owns FAT in others.
There are too much people with some VB experience thinking they can make an operatingsystem.
Hey watch it, you just claimed yours truly is unneeded here :cry:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Quote:
There are too much people with some VB experience thinking they can make an operatingsystem.
Hey watch it, you just claimed yours truly is unneeded here
Perhaps 'too many people with just VB experience...' would be more appropriate :wink:
svdmeer
Member
Member
Posts: 87
Joined: Tue May 06, 2008 9:32 am
Location: The Netherlands

Post by svdmeer »

AJ wrote:
Quote:
There are too much people with some VB experience thinking they can make an operatingsystem.
Hey watch it, you just claimed yours truly is unneeded here
Perhaps 'too many people with just VB experience...' would be more appropriate :wink:
Of course, and thinking so they over-estimate themselves. Not the real OS developers.
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

svdmeer wrote:
AJ wrote:
Hey watch it, you just claimed yours truly is unneeded here
Perhaps 'too many people with just VB experience...' would be more appropriate :wink:
Of course, and thinking so they over-estimate themselves. Not the real OS developers.
I totally agree (rrrrr, hate basic), But I remember there was some guy who said that he wanted to code his OS in some form of basic, what happened to that (Think it might of been crazygray, sounds like something crazy he'd do...), anybody know what happened to that?

Jules
User avatar
JackScott
Member
Member
Posts: 1036
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Post by JackScott »

Well Combuster is busy writing his in FreeBasic... does that count?
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Yayyak wrote:Well Combuster is busy writing his in FreeBasic... does that count?
Oh, didn't know :oops: , how slow does it make it?

Jules
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Also, I have to say you guys are being to nice IMHO, your trying to help somebody to code an OS who barely knows how to code in the appropriate languages and shows that he doesn't even know how instruction flow works, people who don't even no how to code in any language could see where the end of the code was...
Jules
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Post by Ready4Dis »

suthers wrote:
Yayyak wrote:Well Combuster is busy writing his in FreeBasic... does that count?
Oh, didn't know :oops: , how slow does it make it?

Jules
I'm sure it's just as fast as anything that is compiled to native executeable no? I mean, it's a bit lower level than C++, possibly higher than C (not sure, haven't touched freebasic, just remember from my old basic days), so it should land somewhere in that range for speed, assuming it can optomize descently, and depending on how much is required to be written in asm. I don't think there are any issues with writing it in any language you are comfortable with, however if it starts getting big, how many people do you think you are going to be able to recruit to write drivers, programs, etc if it's required to be in basic? Probably a small percent, although if you use a standard file format and calling convention, there is no reason it can't run programs coded in asm, c, c++, pascal/delphi, etc, i think any comparision on speed difference is neglidgeable at best.
User avatar
SphinCorp
Member
Member
Posts: 33
Joined: Sun Jun 01, 2008 1:26 pm
Location: In a pickle...
Contact:

Post by SphinCorp »

What's with the muti-quote?

P.S.: I also know c++, php, html, xml, asp, and am a master of windows cmd (And I have an obsession with DOS 6.22, THE LAST OF THE PURE DOS!)

suthers wrote:
svdmeer wrote:
AJ wrote: Perhaps 'too many people with just VB experience...' would be more appropriate :wink:
Of course, and thinking so they over-estimate themselves. Not the real OS developers.
I totally agree (rrrrr, hate basic), But I remember there was some guy who said that he wanted to code his OS in some form of basic, what happened to that (Think it might of been crazygray, sounds like something crazy he'd do...), anybody know what happened to that?

Jules
BTW: basic rulez.
Locked