visopsys.org

Visopsys Forums
It is currently Sat Jan 20, 2018 12:29 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: 2 Questions...
PostPosted: Sat Jun 11, 2011 3:35 pm 
Offline
User avatar

Joined: Sat Jan 15, 2011 8:06 pm
Posts: 36
Hi.

I have two questions.

Question one: As I don't exactly understand the way your makefiles are set up, how can I make the kernel only using make. This way every little time i make a change, it won't take 5 minutes.

Question two: How do you add functions to kernelAPI.c? I wrote a rounded rectangle function and I want it availible to user programs.

Thank you! :)

:mrgreen: ~osmiumusa

_________________
Lemons. :) Nobody doesn't like lemons!


Top
 Profile  
 
 Post subject: Re: 2 Questions...
PostPosted: Sun Jun 12, 2011 3:10 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
osmiumusa wrote:
Hi.

I have two questions.

Question one: As I don't exactly understand the way your makefiles are set up, how can I make the kernel only using make. This way every little time i make a change, it won't take 5 minutes.


If you just want to make the kernel, change into the kernel directory and type make. Note that if you change a .h file, or the Makefile itself, the whole kernel will be rebuilt. To shortcut this, you could just locate the compiler command output to the screen for the particular file you want to build, and cut-and-paste it.

osmiumusa wrote:
Hi.
Question two: How do you add functions to kernelAPI.c? I wrote a rounded rectangle function and I want it availible to user programs.

Thank you! :)

:mrgreen: ~osmiumusa


There's a little bit of work to this, but it's late and I'm just going to give you a quick answer before I go to bed :animals-chicken:

You should add your function declaration and a new API call number to src/include/sys/api.h, and add an api skeleton symbol/function in src/lib/libc/_kernapi.c, then add parameter definitions in src/kernel/kernelApi.c.

Try picking a random API function (preferably one that isn't too common), and grepping the whole source for instances of its name without the 'kernel' prefix (like if the kernel function is called kernelFooBar(), do 'grep -iR foobar src/' and see the various places it appears, which should mainly be the files I mentioned, plus any userspace programs that call it)

Andy


Top
 Profile  
 
 Post subject: Re: 2 Questions...
PostPosted: Thu Jun 16, 2011 3:54 am 
Offline
User avatar

Joined: Sat Jan 15, 2011 8:06 pm
Posts: 36
I see, so I can just put it in api.h in the order of the functions in the file?

_________________
Lemons. :) Nobody doesn't like lemons!


Top
 Profile  
 
 Post subject: Re: 2 Questions...
PostPosted: Thu Jun 16, 2011 10:51 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
osmiumusa wrote:
I see, so I can just put it in api.h in the order of the functions in the file?


Yes, each function has to have a unique call number also, as you can see in that same file.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group