Page 1 of 1
Kernel and instruction in C
Posted: Sat Mar 27, 2004 3:50 am
by PJ
write instruction in asm:
_next_line:
mov ah, 0Eh
mov al, 0Dh
int 10h
mov al, 0Ah
int 10h
ret
How write instruction in asm runinng in C??
_print: ........?
_scan: .........?
HELP!!!!!
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 4:44 am
by DennisCGc
#include <stdio.h>
printf ("\n");
I don't know when you use it, but should be okay for now ::)
Else you could use inline assembly.
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 7:02 am
by Solar
Dennis, that's nonsense. ???
You can't include anything from the standard library in kernel space because you don't have a standard library in kernel space (unless you ported or implemented one).
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 7:05 am
by DennisCGc
Solar wrote:
Dennis, that's nonsense. ???
You can't include anything from the standard library in kernel space because you don't have a standard library in kernel space (unless you ported or implemented one).
Oops :-[
He should take a look at the website of Chris Giese
www.execpc.com/~geezer
I'm sure he could find some information.
And another thing!
I'm not a C guru, I'm just trying to help
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 8:37 am
by Solar
No offense intended. I wish it were that easy myself.
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 10:06 am
by PJ
Thanks
I please demo function in asm please (printf and scanf)
a'la this:
_next_line:
mov ah, 0Eh
mov al, 0Dh
int 10h
mov al, 0Ah
int 10h
ret
Thanks all
links is good idea
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 10:56 am
by Solar
Check out the FAQ entry
Some small kernels with source.
I'm afraid you will not find "the" solution for your problem. printf() and scanf() both assume the existence of a stdin and a stdout, neither of which are available in kernel space (unless you implement them yourself). For the keyboard, you need an interrupt handler. You have the option to implement your output in text or graphics mode. Lots of design decisions - and that's why we're here in the first place, isn't it?
Re:Kernel and instruction in C
Posted: Sat Mar 27, 2004 2:49 pm
by Schol-R-LEA
Er, perhaps we should back up a bit. PJ, could you clarify what you need? Are you trying to
call an assembly language function from C (or vis versa)? Trying to use
inline assembly code in a C function? Trying to write a printf() function? Some combination of those? Something else?
Re:Kernel and instruction in C
Posted: Sun Mar 28, 2004 12:47 pm
by PJ
I please links to all tutorials and FAQ of this my problem.
Please!!!
I lite speak english
Thanks ALL!!
Re:Kernel and instruction in C
Posted: Sun Mar 28, 2004 9:44 pm
by Solar
Hmm... I am not sure all the FAQ's and tutorials would help you since virtually all of them are in English... and, as Schol-R-LEA correctly pointed out, we're still not even sure what your problem is. You're probably better of trying to explain to us so we can explain to you...
BTW, what is your native language? Perhaps someone speaking the same language is in a mind of contacting you by e-mail...
Re:Kernel and instruction in C
Posted: Mon Mar 29, 2004 2:11 am
by Pype.Clicker
Solar wrote:
BTW, what is your native language? Perhaps someone speaking the same language is in a mind of contacting you by e-mail...
Given the ".pl" extension of his mailbox, i guess he's from Poland (hope that's the correct spelling)...
Re:Kernel and instruction in C
Posted: Mon Mar 29, 2004 2:35 am
by Solar
You're right, of course... *stupidme*...
All I can offer is German... :-\
Re:Kernel and instruction in C
Posted: Mon Mar 29, 2004 3:44 pm
by Adek336
May I humbly offer my help? Polish- that's my native language.
W czym moge sluzyc, PJ? Zyczysz sobie napisac printf w asm, czy wykorzystac funkcje z asm w C, czy .. ?
(english:How can I help you PJ, do you want to write printf in asm or use an asm routine in C.)
Cheers,
Adrian
Re:Kernel and instruction in C
Posted: Mon Apr 05, 2004 5:46 am
by PJ
Chodzi mi o jakieś wytłumaczenie na temat tworzenia funkcji C w asm tzn jak trzeba je konstruować, jak się dane pobiera, jakie są podstawowe przerywania itp może masz jakieś linki o tym a może nawet po polsku?
Re:Kernel and instruction in C
Posted: Mon Apr 05, 2004 6:10 am
by Pype.Clicker
glad to see you finally found each other ... may i suggest you continue the discussion through a private channel ... the poor us that do not have cyrillic support installed see � everywhere ::)