Where do i start??

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
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Where do i start??

Post by Pype.Clicker »

and to be complete, don't forget that asm operation can have only one memory operand: the other operand is always immediate constant or a register, so

Code: Select all

mov [foo],[bar]
is unlikely to work: you'll have to use an intermediate register

Code: Select all

mov eax,[bar]
mov [foo],eax
Berserk

Re:Where do i start??

Post by Berserk »

Thank you soo much,

Your help is VERY appreciated. But i haven't read through this information YET! Because i need some answers to some other questions before i start Learning assembler!

So please do not think that your time has been wasted.

I have compiled ther Hello World progran and it works!!
I will start learning assembler and all these other things you have posted after i get some other questions answered. Have a look at them at this thread: "STARTING A NEW OS (Operating System)"

Thank you again for your help, i have actually taken all of this assembler information and saved it into a HTML file.

Please have a look at my other thread, as i said i will start on learning assembler, AFTER i get answers to questions in that thread!

Please help out,
ciao... 8)
elias

Re:Where do i start??

Post by elias »

if you wan tot learn assembly and hex and all that crap, search up Art of Assembly on google. its an online book thats the best way to learn. i used to feel just like you, and thought i would never learn it cuz it was so hard. not so. read that book and youll learn assembly. its jsut that good.
Tom

Re:Where do i start??

Post by Tom »

[attachment deleted by admin]
Berserk

Re:Where do i start??

Post by Berserk »

thanks,

it's a good tutorial.

as for the FritzOS, i just don't know how to put the bootsector and kernel on the disk???

Do you have a floppy image??

If you don't, i recommend you make one, Use RawWrite.

ciao. 8)
Tom

Re:Where do i start??

Post by Tom »

ok...I will make a image. Soon, I think I might add a windows installer for FritzOS.

I'll make a image with source installer in pk0.7 for win32
PlayOS

Re:Where do i start??

Post by PlayOS »

OK, I finally got around to making something for this thread for newbies.

This file http://home.kooee.com.au/tim_danielle/o ... kernel.zip has everything you need to just download, unzip and run the batch file, if you are using windows. Dont forget to insert the floppy disk.

If you are using linux, just open the .bat file in a text editor and then execute each command manually.

This boot code and c kernel are not meant to be a replacment for reading and learning yourself, as IMHO you can only understand properly but reading the appropriate documents. I recommend the Intel Manuals for a complete understanding of the processor get them here http://www.intel.com/design/pentium/manuals/, however sometimes the manuals are a little bit vauge on a topic but with supplemental articles and example code you should be okay, afterall this is how I have learnt what I have.

In a few weeks I will probably upgrade this example to include basic paging, however I have no time for this at the moment, but when it is done I will post it in this thread.

Good luck, and keep at it. You WILL get there in the end. Wherever there may be. ;)
Berserk

Re:Where do i start??

Post by Berserk »

Hey,

Firstly, for Tom, When you make a floppy image be sure to post it up on this thread. I highly recommend an floppy image to anybody, i will make one when i start my own OS. Not many people can be bothered or even know how to put all the files onto a floppy using PartCopy or What-Not. Please make a floppy image and post it here, and i will finally be able to try your OS. Thanks ;)

As for PlatOS, the package looks good, i'm just abut to try it, it really does have everything i need to start off, thanks it will be a great example ;D

And keep up the good work, i look forward to a more advanced and biger version of the package, What is Paging anyway??

And, Where can i get your OS (PlayOS) i want to try it?
But if you don't have a floppy image for it, i'm not going to try it ;D

P.S. I use Windows XP Home-Edition (Just so you know)

ciao 8)
PlayOS

Re:Where do i start??

Post by PlayOS »

Unfortunately my OS is not ready to be used, but when it is I will definately post it.

Paging is an advanced way to manage memory, it is not a simple thing to explain, but IMHO it is fairly simple to implement, the only thing that is difficult is understanding the concept, but once you grasp the concept you will understand how powerful it really is. In the upgraded example kernel I will have a very well commented implementation of the process, so I will leave it until then. I will also have a working IDT in the next version of the example.

Good Luck!
Tom

Re:Where do i start??

Post by Tom »

[attachment deleted by admin]
mrd

Re:Where do i start??

Post by mrd »

i have a nice summary of x86 paging on my site, http://mrd.knows.it .
Berserk

Re:Where do i start??

Post by Berserk »

Hey ;D

Thanks, i'm about to try FritzOS.
(I got WinRAR)

now for PlayOS,

Do you have a "in" function, for the OS example_kernel?? (like cin, in C++)

Can i change the compiler from GCC to DJGPP??
and if i do, can i change the file to kernel.cpp and put C++ things in it??

And also, i probably won't right a bootsector now, i will use this one, but i will write a kernel and it will be 100% original!!

Now i see the kernel as the OS's main program! So now, if i had a in function, could i just use the kernel as a giant program and load things from it??

Understand what i mean??

and also could you label the kernel better explaining what the hell is asm("jmp _kernel_start") well whatever it is, i changed it to
asm("JMP _OperatingSystem_Kernel")
and i changed the main functions name to OperatingSystem_Kernel is it Ok if i do this??
The OS works fine when i do it!

thanks for everything, and please help me out with these couple of questions!

ciao 8)
Berserk

Re:Where do i start??

Post by Berserk »

One more thang,

what do the outb and inb functions in the Kernel do??

If they don't do anything importand i'm going to delete them ;D

ciao 8)
eliscool

Re:Where do i start??

Post by eliscool »

a) you shouldnt really steal everyones code... >:(
b) I think theres nothing wrong with "kernel_start" for the function name, its where the kernel starts, init's stuff then goes off to other control functions...
c) Duh! they read and write to the ports!! (drives, perpherials etc)
PlayOS

Re:Where do i start??

Post by PlayOS »

At the moment I do not have an "cin" function like c++, if you want to use such functions you will need to add the support for c++, I am not going to be doing this for a while.

As far as I know all the code should compile in a c++ file, I see no reason why not. (anyone else know otherwise?)

You are MORE than welcome to use all of this code in your own OS, however I would suggest that for your own knowledge that you at least understand everything that is done.

Yes you can use your kernel like a main function, but as soon as your kernel returns it will most likely reboot your PC, so you will need to make sure that you create a loop at the end of the kernel, and you could control your OS from within this loop, (something similar to loop in a windows program, at the end of every winmain() function)

I am going to comment the whole thing better for the next version, I was a bit slack in this one, however the asm("jmp _kernel_start") is just some inline asm, it is the first piece of code to execute when I jump to the kernel, by having this you can use literal strings in your kernel_start without any problems, normally gcc puts all literal strings just before the function code, and if this is your kernel_start then when you jump to it, you will be executing data rather than code, so by doing this you can effectively jump the data.

Once again, you can do what you like with this code, change names whatever, except just as long as you know that there could end up being alot of people with the same thing, so effectively you could never copyright it. Not that particular code anyway.

Well, that its I think, I am glad to help and even though the rudness of eliscool in not needed, I still think for your own knowledge you should try to understand everything you are using, this way you learn as well.

Good Luck, and keep at it.
Post Reply