Hi,
I am trying to write my own printf function . I dont want to use the stdarg.h since i am going to use this function in real mode (during booting). So i need to access the arguments from memory directly.
I want to understand how the arguments are stored when they are passed to the stack. I am using the gcc compiler on linux to compile and run my programs ..
I already have routines to print short, long, int and characters. This is how i plan to implement my function :
int printf(char *str,...)
Sample call : printf ("%c%d",'a',45)
In printf , I will have the address of the string str so I will scan that and count the number of arguments and their types. Now using this information and the address of the first argument str, I need to get access to the other arguments on the stack .
I dont want to add checks and just want basic functionality.
Any help is appreciated.