OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 9:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Genisoimage on OSX
PostPosted: Sat Feb 04, 2012 1:38 am 
Offline
Member
Member
User avatar

Joined: Tue Dec 27, 2011 7:57 am
Posts: 368
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:
note: if this code is reached, the program will abort.


from this code:

Code:
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:
#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?

_________________
[nx] kernel: http://github.com/zhiayang/nx


Top
 Profile  
 
 Post subject: Re: Genisoimage on OSX
PostPosted: Sat Feb 04, 2012 7:02 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 27, 2011 7:57 am
Posts: 368
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.

_________________
[nx] kernel: http://github.com/zhiayang/nx


Top
 Profile  
 
 Post subject: Re: Genisoimage on OSX
PostPosted: Sun Feb 05, 2012 6:59 am 
Offline
Member
Member
User avatar

Joined: Tue Dec 27, 2011 7:57 am
Posts: 368
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:

_________________
[nx] kernel: http://github.com/zhiayang/nx


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group