visopsys.org
http://visopsys.org/forums/

2 Questions...
http://visopsys.org/forums/viewtopic.php?f=3&t=92
Page 1 of 1

Author:  osmiumusa [ Sat Jun 11, 2011 3:35 pm ]
Post subject:  2 Questions...

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

Author:  andymc [ Sun Jun 12, 2011 3:10 am ]
Post subject:  Re: 2 Questions...

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

Author:  osmiumusa [ Thu Jun 16, 2011 3:54 am ]
Post subject:  Re: 2 Questions...

I see, so I can just put it in api.h in the order of the functions in the file?

Author:  andymc [ Thu Jun 16, 2011 10:51 am ]
Post subject:  Re: 2 Questions...

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.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/