From OSDev Wiki
Jump to navigation Jump to search

About Me

I like pancakes, bacon, butter, and syrup.

I like X86/X64 but they can be really complex, and a lot of their stuff is pages and pages deep and you know something fresh and new is always great. So I spend most of my time messing with stuff like ARM, MIPS (even if it is possibly dieing), or anything else. I recommend the book See Mips Run by Dominic Sweetman. Its a very good book about MIPS or really any RISC processor.

Some people may think (or would think if they knew, LOL) - "Why does he spend all this time throwing away information instead of stuffing it into some book and selling it to people". Well, I used to be just like a lot of you. Not all, because some of you are better than me. But, a many of you are just like I was almost 10 years ago. And, some legendary people who's names are to be forever etched into history gave me the knowledge through tutorials, documentation, and examples to write or even attempt to write system level software. Of, course I did not say their names would be remembered only etched into history. For you see no one may ever remember your contributions to the world, but they can never remove them no matter how hard they try. Because, with out them the time of present just would not be but instead something entirely different. I guess what I am trying to say is:

There are things in life you will do in order to help others even though you understand you may never be repaid for. A sacrifice if you will to others in return for the sacrifice someone made to you. --
"The greatest tyrannies are always perpetrated in the name of the noblest causes." -- Thomas Paine
"In the beginning of a change the patriot is a scarce man, and brave, and hated and scorned. When his cause succeeds, the timid join him, for then it costs nothing to be a patriot." -- Mark Twain

Pages Under My Namespace


Printf Debugging Tool

Instead of banging your head trying to get it figured out. You can instead spend more time on figuring other things out. You need a implementation of putc for characters and puts for strings. Also just do the #include <stdarg.h> if you get compiler complaints about vararg structures.

    Leonard Kevin McGuire Jr ( ([email protected])

    This code is so simple that there is NO reason to add some legal
    wording for copying. Just copy and paste it all you like.

const char *itoh_map = "0123456789ABCDEF";

char* itoh(int i, char *buf)
	int		n;
	int		b;
	int		z;
	int		s;
	if (sizeof(void*) == 4)
		s = 8;
	if (sizeof(void*) == 8)
		s = 16;
	for (z = 0, n = (s - 1); n > -1; --n)
		b = (i >> (n * 4)) & 0xf;
		buf[z] = itoh_map[b];
	buf[z] = 0;
	return buf;

void kprintf(const char *fmt, ...)
	const char 	*p;
	va_list 	argp;
	int 		i;
	char 		*s;
	char 		fmtbuf[256];

	va_start(argp, fmt);

	for(p = fmt; *p != '\0'; p++)
		if(*p != '%')

			case 'c':
				i = va_arg(argp, int);
			case 's':
				s = va_arg(argp, char *);
			case 'x':
				i = va_arg(argp, int);
				s = itoh(i, fmtbuf);
			case '%':