Getting a OS going quickly.

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.
James

Re:Getting a OS going quickly.

Post by James »

I don't want to run FritzOS. I am just cannibalizing some of its code. Is that OK? I compiled the above ASM instructions and now I want to put them onto a floppy. How do I make the compiled code into the boot strip on the floppy?
Thank you for your time,
Arrummzen
jrfritz

Re:Getting a OS going quickly.

Post by jrfritz »

dd if=<your boot.bin> of=/dev/<your floppy drive>

and reboot to test your code.
jrfritz

Re:Getting a OS going quickly.

Post by jrfritz »

Did that work?
James

Re:Getting a OS going quickly.

Post by James »

Yep! It works! Will you give a link to some documents on protected mode and the BIOS functions. By the way, thanks for the link to your source code. MUCH essayer to understand the the BSD code. Is there a big table or something with a list of every X86 ASM instruction and every register with a brief description of each? I don't want a big document I just want the basics, 1 page devoted to each instruction or something.
Thank you for your time,
Arrummzen
Guest

Re:Getting a OS going quickly.

Post by Guest »

This is the Intel Instruction Set Refernece, it is 6.62mb in size but it gives you a complete description of each instruction.

ftp://download.intel.com/design/Pentium ... 547109.pdf

hope this helps.
jrfritz

Re:Getting a OS going quickly.

Post by jrfritz »

What do you mean it's easier to understand the BSD code?
damonbrinkley

Re:Getting a OS going quickly.

Post by damonbrinkley »

I believe he/she meant 'it's easier to understand than then BSD code'
jrfritz

Re:Getting a OS going quickly.

Post by jrfritz »

My code is easier to understand than the BSD code?
James

Re:Getting a OS going quickly.

Post by James »

IMHO your code is was essayer for me to wrap my mind around. Its small and strait to the point.
Any idea ware I can get a hard copy of that pdf (without printing it?).
Thank you for your time,
Arrummzen
James

Re:Getting a OS going quickly.

Post by James »

What about BIOS calls? Someone has to have put together a big reference book with all the BIOS call, CPU instructions and registers in it.
Thank you for your time,
Arrummzen
James

Re:Getting a OS going quickly.

Post by James »

I have another question. Whats the easiest way to get a C kernel loaded? I am using the gcc tools to compile/build my kernel. I more or less copied the FritzOS boot loader. I don't want to use a ASM and C kernel like Fritz douse. Is there anyway I can load my C kernel without ASM? If so, how do I declare main, how do compile and build it and then put it on the floppy (what are the commands)? What is the in-line ASM macro in gcc (I want to embed ASM code in my C code)?
Thank you for your time,
Arrummzen
Curufir

Re:Getting a OS going quickly.

Post by Curufir »

The easiest way (So I've been told) is to create your kernel in elf format and get GRUB to load it for you.

Try these: HelpPC (For BIOS Interrupts/Instruction set), Ralf Brown's Interrupt List (For...*drumroll*...interrupts and ports), the NASM manual for a description of the intel instructions, the intel opcode manual (Usually number 2 of a series of 3/processor. There was a recent link on here). All those are easily accessible via google, so I'm not gonna go find them for you.
jrfritz

Re:Getting a OS going quickly.

Post by jrfritz »

[attachment deleted by admin]
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Getting a OS going quickly.

Post by df »

James wrote: I have another question. Whats the easiest way to get a C kernel loaded? I am using the gcc tools to compile/build my kernel. I more or less copied the FritzOS boot loader. I don't want to use a ASM and C kernel like Fritz douse. Is there anyway I can load my C kernel without ASM? If so, how do I declare main, how do compile and build it and then put it on the floppy (what are the commands)? What is the in-line ASM macro in gcc (I want to embed ASM code in my C code)?
use grub. there is msdos floppy disks with grub on them, all you have to do is copy your kernel file over to the grub disk, its that simple.
-- Stu --
jrfritz

Re:Getting a OS going quickly.

Post by jrfritz »

The Asmmbly command in GCC is in AT&T syntax...if you want NASM syntax in your C code, you do this:

#define inasm(s) asm( ".intel_syntax no_prefix" ); asm(s);asm(".att_syntax prefix" );

and in your main C code, do this ( with pk0.3 that I posted above ):

void start()
{
// stuff
// asm code in GCC:
inasm( "Your Assembly Stuff Here" );
inasm( "mov eax, 1\n
mov ebx, 2" );

}
Post Reply