hey all... have been lurking the boards heavily for about 2 weeks now... the last 2 days i have started my own kernel... i had a bootsector working, but then it came time to enabling protected mode, and instead of simply learning the code to write, i would rather have a better grasp of the concept before i actually do the code. yeah I could memorize the steps to get into pm but I wont learn anything about how it works, so i decided to throw someone else's bootsector/loader (it supported fat 16 (12?)) on my floppy so i could do some kernel work. so far i have a basic print function working and tonight im going to work on my video driver a little bit more... i am developing on win32 (winxp pro)... I would rather develop on my linux machine, but thats the machine im testing the floppy in I am currently using djgcc and nasm through the dos box, but i am not very fond of the at&t asm syntax that djgcc loves. i was wondering about using other compilers, i saw some people mention MinGW, i will probably take a look at it, also cygwin ive seen you guys talking about.
Also, it seemed djgcc didn't like that i named one of my functions "printf"... hmm... is there a way to disable the builtin libraries so it doesnt care about all that? ;p
anyways, i intended this to be more of a 'hello' message than what it turned out to be... but... hello!
developing in win32
Re:developing in win32
Welcome!anyways, i intended this to be more of a 'hello' message than what it turned out to be... but... hello!
There should be compiler flags like -nostdinc and -fno-builtin, and the linker flag --nostdlib.Also, it seemed djgcc didn't like that i named one of my functions "printf"... hmm... is there a way to disable the builtin libraries so it doesnt care about all that? ;p
Isn't that why you are using nasm? ???I am currently using djgcc and nasm through the dos box, but i am not very fond of the at&t asm syntax that djgcc loves.
Cygwin, MinGW, and DJGPP are all clones of the gcc compiler that's used on Linux. Since AT&T syntax is the standard in UNIX/Linux, gcc (and therefore Cygwin, MinGW, and DJGPP) all use AT&T syntax assembly. I know, I hate it tooi was wondering about using other compilers, i saw some people mention MinGW, i will probably take a look at it, also cygwin ive seen you guys talking about.
I've heard that GAS accepts a ".intel_syntax" directive which causes it to accept valid Intel syntax assembly, but I haven't really experimented with it.
Re:developing in win32
Ok, Cygwin isn't *just* gcc, its a whole UNIX development environment, and DJGPP can be a whole UNIX environment, too. Just wanted to restate this before the computing gods descend upon me.Cygwin, MinGW, and DJGPP are all clones of the gcc compiler that's used on Linux.
Re:developing in win32
well, nasm is great, and i hate gcc too. Now that that is done, gcc at&t asm isn't that bad,except withvars ie:
asm("mov ax,1 \n",
"mov bx,2 \n",
"mov cx,3 \n");
that works fine, without varsmit is simple. Just other stuff like vars and passing info to gcc is hard.
----
Figure out mode for urself,it's a big hurdle, i know.
----
Batch files also help alot! code a simple one that calls nasm,gcc,and ld to build a main image binary
regards,
mr. xsism
asm("mov ax,1 \n",
"mov bx,2 \n",
"mov cx,3 \n");
that works fine, without varsmit is simple. Just other stuff like vars and passing info to gcc is hard.
----
Figure out mode for urself,it's a big hurdle, i know.
----
Batch files also help alot! code a simple one that calls nasm,gcc,and ld to build a main image binary
regards,
mr. xsism
Re:developing in win32
Actually I was regarding using the inline asm... I guess i just have to look up how to write an asm function, then use it in the C source, and compile it all into one program :-XIsn't that why you are using nasm? ???I am currently using djgcc and nasm through the dos box, but i am not very fond of the at&t asm syntax that djgcc loves.
Re:developing in win32
rdragon:
mr. xsism:
See http://www.osdev.org/developers/guide01/index.htmlActually I was regarding using the inline asm... I guess i just have to look up how to write an asm function, then use it in the C source, and compile it all into one program
mr. xsism:
That looks like Intel assembly to me. You have no $ before constants, and the source/dest operands are supposed to be switched...Now that that is done, gcc at&t asm isn't that bad,except withvars ie:
asm("mov ax,1 \n",
"mov bx,2 \n",
"mov cx,3 \n");
Re:developing in win32
Oh yeah, and if you already know Intel assembly and want to know the differences between Intel and AT&T assembly, take a look at this link:
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html