i want to thanks all of u, how take the pain to reply to me,
what's was the need of mixing two langages, was to write my own new OS, to grasp all the internal architecture, and to understand how an os works,
To achieve this two goals, writing it in just full assembly was a bit amazing, that's why was the choice, to mix'em up
so here is what i found, for the persons who'r interesed in...
First, the first function called in a C program, is _start, not the main. it's responsible to settinp and initializing up the environment, so that printf, and scanf will run clearly.
the C skelton, is
----------- snippet ------------------
extern void SomeAsmFunction(void);
void _start (void) {
...
SomeAsmFunction();
...
}
------------------------------------------------
compile it with bcc -c -mt skeleton1.c
and the ASM one, look like this,
-----------------------------------------------
_TEXT segment byte 'CODE'
PUBLIC SomeAsmFunction
SomeAsmFunction PROC
mov ah,09
....
RET
SomeAsmFunction ENDP
_TEXT ends
------------------------------------------------
compile it with
TASM AsmOne.asm
then the linkage, .... tlink selton1.obj AsmOne.obj
EXe2bin Skelton1.exe ske.exe
and u get a 11 byte file, that don't call any interrupt, that was my disappointement, when i realise, that i can't call any of the CRT library, when coding your own OS.
what's was the need of mixing two langages, was to write my own new OS, to grasp all the internal architecture, and to understand how an os works,
To achieve this two goals, writing it in just full assembly was a bit amazing, that's why was the choice, to mix'em up
so here is what i found, for the persons who'r interesed in...
First, the first function called in a C program, is _start, not the main. it's responsible to settinp and initializing up the environment, so that printf, and scanf will run clearly.
the C skelton, is
----------- snippet ------------------
extern void SomeAsmFunction(void);
void _start (void) {
...
SomeAsmFunction();
...
}
------------------------------------------------
compile it with bcc -c -mt skeleton1.c
and the ASM one, look like this,
-----------------------------------------------
_TEXT segment byte 'CODE'
PUBLIC SomeAsmFunction
SomeAsmFunction PROC
mov ah,09
....
RET
SomeAsmFunction ENDP
_TEXT ends
------------------------------------------------
compile it with
TASM AsmOne.asm
then the linkage, .... tlink selton1.obj AsmOne.obj
EXe2bin Skelton1.exe ske.exe
and u get a 11 byte file, that don't call any interrupt, that was my disappointement, when i realise, that i can't call any of the CRT library, when coding your own OS.
Actually, the "name of the entrypoint" is chosen by the writers of
whatever C runtime you're using. And various different names have
been used. And the very first entrypoint is controlled by nothing else
than a linker switch.
As for writing your own OS, you have to read and read and read
and... it will probably take a handful of years before you are ready
to take even the first vague steps :).
whatever C runtime you're using. And various different names have
been used. And the very first entrypoint is controlled by nothing else
than a linker switch.
As for writing your own OS, you have to read and read and read
and... it will probably take a handful of years before you are ready
to take even the first vague steps :).
thanks, and especially for disease_2000