what to learn?

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
njkt
Posts: 9
Joined: Sun Oct 24, 2004 11:00 pm

what to learn?

Post by njkt »

hey,
im new here (and to OS development)
I was wondering what I should do to start making my own operating system. I have been working on a bootstrap in x86 asm but its weird :P

any thoughts?

[edit]i forgot to mention, i would like to do this all in x86 asm.
Last edited by njkt on Mon Oct 25, 2004 11:00 pm, edited 1 time in total.
cipek
Member
Member
Posts: 43
Joined: Mon Oct 25, 2004 11:00 pm
Location: Poland

Re: what to learn?

Post by cipek »

I do my simple OS project in x86 asm and i think it's good language to OS programming, but you can try do sth in C/C++
slipstream
Posts: 1
Joined: Mon Oct 25, 2004 11:00 pm

Re: what to learn?

Post by slipstream »

i like to us C, it seems more reilable, and plus alot of people avoid C++, ASM is great for bootloaders, and some small parts of the kernel, for added functionality but most of the kernel i use C, but asm is fine if you don't mind writing a alittle more code :)
The meaning of life 101101
njkt
Posts: 9
Joined: Sun Oct 24, 2004 11:00 pm

Re: what to learn?

Post by njkt »

yeah, this is a floppy disk sized OS. the only thing is im a bit confused on what to do for this whole thing (may be in over my head lol)
Wishmaster
Posts: 2
Joined: Tue Oct 26, 2004 11:00 pm
Location: Germany / NRW / Coesfeld

Re: what to learn?

Post by Wishmaster »

I prefer Sphinx C-- for os development. Because its very lowlevel, you can directly add ASM with Intel-Syntax ( i hate AT&T syntax ). There are 2 ways to do that.

Code: Select all

asm {
           mov ah,0x0E
           mov al,1
           mov bx,0x0007
           int 0x10
}
Or

Code: Select all

void main() {
          $mov ah,0x0E
          $mov al,1
          $mov bx,0x0007
          $int 0x10
}

or

void main() {
         AH = 0x0E;
         AL = 1;
         BX = 0x0007
         $int 0x10
}
You can easyily create interrupts in 16 / V86 mode.

Code: Select all

interrupt _int_0x20 {
}

SETINTVECT( ..... )
Its just easy to create binary files !
Use C-- yourfile.c to create a .COM file or C-- /B32 yourfile.c
to create a 32bit binary file.

Theres ES/DS/FS/GS BYTE/WORD/INT/LONG/DWORD/FLOAT for memory access.

Code: Select all

ES = 0;
ESBYTE[0x7C00] = 0x05;
ESWORD[0x5500] = 0x10FF;
ESINT....
ESDWORD...
You can check the flags with:

Code: Select all

           CARRYFLAG
           NOTCARRYFLAG
           OVERFLOW
           NOTOVERFLOW
           ZEROFLAG
           NOTZEROFLAG
           MINUSFLAG
           PLUSFLAG

           if(CARRYFLAG) { ..... }
You can use fastcall, inline, pascal, stdcall .. . for functions.

Code: Select all

fastcall void Test(AX) 
int x = 5;
{
    int y = 0;
    $POP y
}
the int x = 5; means that you declare this var on the stack.

Ah i could write a long story about Sphinx C--, its the best you read the doc. I like C-- very much !

Heres the link http://c--sphinx.narod.ru/indexe.htm

Bye.
cipek
Member
Member
Posts: 43
Joined: Mon Oct 25, 2004 11:00 pm
Location: Poland

Re: what to learn?

Post by cipek »

Nice code :D Probably this code can help somebody :)
njkt
Posts: 9
Joined: Sun Oct 24, 2004 11:00 pm

Re: what to learn?

Post by njkt »

hey,
im not really wanting to use C much (if any)
cipek
Member
Member
Posts: 43
Joined: Mon Oct 25, 2004 11:00 pm
Location: Poland

Re: what to learn?

Post by cipek »

It mustn't help you. I mean can help somebody. I using just asm but code is nice :D
Smith
Member
Member
Posts: 38
Joined: Wed Feb 02, 2005 12:00 am

Re: what to learn?

Post by Smith »

I'm trying C++ .
neil
Posts: 8
Joined: Fri Feb 25, 2005 12:00 am
Location: Nice, France
Contact:

Re: what to learn?

Post by neil »

I prefer Sphinx C-- for os development. Because its very lowlevel, you can directly add ASM with Intel-Syntax ( i hate AT&T syntax ).
Note that it is also possible to use and generate the Intel syntax with GCC and GAS. You can even change the AT&T syntax by removing the %before the registers. See -masm (gcc), .intel_syntax (gas), google...

I love gas ;)
Last edited by neil on Tue Mar 08, 2005 12:00 am, edited 1 time in total.
frizzz
Member
Member
Posts: 36
Joined: Sat Oct 30, 2004 11:00 pm
Location: Germany
Contact:

Re: what to learn?

Post by frizzz »

I found, that nasm is the best assembler dialect (near to intel!) and wrote an OS using this language. A lot of things You could desire are done already! Look at my homepage
www.rcfriz.de
contact me, using
[email protected]

frizzz
Post Reply