Genisoimage on OSX

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Genisoimage on OSX

Post by zhiayang »

So I just (attempted to) move development to osx (was running linux in VM before), and I'm stuck: How do I get the genisoimage command? I'm currently using GRUB eltorito for booting my kernel.

Also, I get this warning from gcc (cross compiler) which I didn't have in linux (non cross compiler)

Code: Select all

note: if this code is reached, the program will abort.
from this code:

Code: Select all

void kprintf(char str[], ...)
{
	va_list listptr;
	va_start(listptr, str);
	
	short is_percent = 0;
	
	register int i = 0;
	for(; i < strlen(str); i++)
	{
		if(str[i] == '%')
		{
			is_percent = 1;
			continue;
		}	
		if(is_percent)
		{
			switch(str[i])
			{
				case 'd':
					putnum(va_arg(listptr, int));
					break;
					
				case 'c':
					putch(va_arg(listptr, unsigned char));      //Faulty line, all others work.
					break;					
							
				case 'x':
					puthex(va_arg(listptr, unsigned int));
					break;		
					
				case 's':
					puts(va_arg(listptr, char*));
					break;
					
				case 'u':
					putunum(va_arg(listptr, unsigned long));
					break;
			}
			is_percent = 0;
		}		
		else
		{
			putch(str[i]);
		}
	}
}
Yes, I do have va_list etc defined, as such:

Code: Select all

#define va_start(v,l) __builtin_va_start(v,l)
#define va_arg(v,l)   __builtin_va_arg(v,l)
#define va_end(v)     __builtin_va_end(v)
#define va_copy(d,s)  __builtin_va_copy(d,s)
typedef __builtin_va_list va_list;
Halp?
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Genisoimage on OSX

Post by zhiayang »

Great, thanks for that. But what about the other issue? I get an invalid opcode exception if I "kprintf(%c)"...



EDIT:::::
Did some tedious research, turns out that a 'char' is promoted to an int with va_arg. So there.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Genisoimage on OSX

Post by zhiayang »

berkus wrote:That you could figure out with a bit of googling and even a thread on this forum.

Suffice to say that minimum increment of (E)SP is not 1.

requimrar wrote: tedious research
Tedious my @$$, 2 minutes googling is tedious nowadays?

Pardon me, perhaps 'tedious' was an over-exaggeration... :oops:
Post Reply