* QUestion on C language
@ 2010-12-22 17:43 bhuvan gupta
2010-12-22 20:33 ` Mulyadi Santosa
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: bhuvan gupta @ 2010-12-22 17:43 UTC (permalink / raw)
To: kernelnewbies
Respected sir,
I am Bhuvan Gupta, a B.Tech student.(got your id from yours " USB LED driver
- 1.1 ")
)
With due respect, I humbly request you to please throw some light on to
below written question. i will highly appreciate your efforts.
[1] when we use C language,we use diferent library to do different thing.As
also in your case you use module.h,init.h etc
but how to write this library , in what language they are written in as
standard ANSI C has round about 32 keywords ?
what should i read and learn to the related topic .
please suggest something
(I do have knowledge of Assembly).
please help,this question making me beacen
it will be honour if you reply.
thank you
Bhuvan Gupta
India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101222/fd154b48/attachment.html
^ permalink raw reply [flat|nested] 5+ messages in thread* QUestion on C language
2010-12-22 17:43 QUestion on C language bhuvan gupta
@ 2010-12-22 20:33 ` Mulyadi Santosa
2010-12-22 21:31 ` Greg Freemyer
2010-12-23 4:06 ` Alex John
2 siblings, 0 replies; 5+ messages in thread
From: Mulyadi Santosa @ 2010-12-22 20:33 UTC (permalink / raw)
To: kernelnewbies
Hi...
On Thu, Dec 23, 2010 at 00:43, bhuvan gupta <bhuvangu@gmail.com> wrote:
> With due respect, I humbly request you to please throw some light on to
> below written question. i will highly appreciate your efforts.
You're a bit humble and polite than your predecessors :D but still, OOT is OOT
> but how to write this library , in what language they are written in?as
> standard ANSI C ?has round about 32 keywords ?
What do you mean by 32 keywords? Writing C library is like writing
normal code...
just watch out, we're target kernel space here. You can't use normal
libc function....so for example instead printf, you have to use
printk() or similar. And no floating point number operation...
NB: assuming you wanna made user space DSO (Dynamic Shared Object), is
just the code would be made as PIC (AFAIK it means Position
Independent Code). Google for ld (linker) to find out more about it.
here's one: http://www.gentoo.org/proj/en/hardened/pic-internals.xml
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* QUestion on C language
2010-12-22 17:43 QUestion on C language bhuvan gupta
2010-12-22 20:33 ` Mulyadi Santosa
@ 2010-12-22 21:31 ` Greg Freemyer
2010-12-23 4:06 ` Alex John
2 siblings, 0 replies; 5+ messages in thread
From: Greg Freemyer @ 2010-12-22 21:31 UTC (permalink / raw)
To: kernelnewbies
On Wed, Dec 22, 2010 at 12:43 PM, bhuvan gupta <bhuvangu@gmail.com> wrote:
> Respected sir,
> I am Bhuvan Gupta, a B.Tech student.(got your id from yours "?USB LED driver
> - 1.1 ")
> )
> With due respect, I humbly request you to please throw some light on to
> below written question. i will highly appreciate your efforts.
> [1] when we use C language,we use diferent library to do different thing.
Unless I totally misunderstand, the Linux Kernel does not have any
libraries. It's core is a monolithic program to which modules can be
loaded. To think of it as a library is not instructive in my mind.
> As
> also in your case you use module.h,init.h etc
> but how to write this library , in what language they are written in?as
> standard ANSI C ?has round about 32 keywords ?
Again the kernel core is not a library, but the linux kernel core is
primarily written in C, but some of the functions are indeed in
assembly.
Note that ANSI C is not precisely the language in question. Many GCC
extensions are used. One example is the keyword, "unlikely".
> what should i read and learn to the related topic .
> please suggest something
The GCC manuals are a necessary reference as well. You can find them online.
> (I do have knowledge of Assembly).
In general you can avoid most assembly if you are not porting the
kernel to a new cpu/MB/chipset.
> please help,this question making me beacen
> it will be honour if you reply.
> thank you
> Bhuvan Gupta
Good Luck
Greg
^ permalink raw reply [flat|nested] 5+ messages in thread
* QUestion on C language
2010-12-22 17:43 QUestion on C language bhuvan gupta
2010-12-22 20:33 ` Mulyadi Santosa
2010-12-22 21:31 ` Greg Freemyer
@ 2010-12-23 4:06 ` Alex John
2010-12-23 6:54 ` Pei Lin
2 siblings, 1 reply; 5+ messages in thread
From: Alex John @ 2010-12-23 4:06 UTC (permalink / raw)
To: kernelnewbies
On 23 Dec 2010, at 01:43, bhuvan gupta <bhuvangu@gmail.com> wrote:
> Respected sir,
>
> I am Bhuvan Gupta, a B.Tech student.(got your id from yours " USB LED driver - 1.1 ")
> )
> With due respect, I humbly request you to please throw some light on to below written question. i will highly appreciate your efforts.
>
> [1] when we use C language,we use diferent library to do different thing.As also in your case you use module.h,init.h etc
> but how to write this library , in what language they are written in as standard ANSI C has round about 32 keywords ?
> what should i read and learn to the related topic .
AFAIK, the kernel does not involve heavy use of any library. Talking from a non kernel view, you know that .h files are header files. You can google that. The language is still C as they're C headers. What do you mean when you say "as standard ANSI C has round about 32 keywords" ?
>
> please suggest something
>
> (I do have knowledge of Assembly).
>
> please help,this question making me beacen
>
> it will be honour if you reply.
>
> thank you
> Bhuvan Gupta
> India
Cheers
- Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20101223/483a4135/attachment.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* QUestion on C language
2010-12-23 4:06 ` Alex John
@ 2010-12-23 6:54 ` Pei Lin
0 siblings, 0 replies; 5+ messages in thread
From: Pei Lin @ 2010-12-23 6:54 UTC (permalink / raw)
To: kernelnewbies
2010/12/23 Alex John <alex@archeleus.com>:
> On 23 Dec 2010, at 01:43, bhuvan gupta <bhuvangu@gmail.com> wrote:
>
> Respected sir,
> I am Bhuvan Gupta, a B.Tech student.(got your id from yours "?USB LED driver
> - 1.1 ")
> )
> With due respect, I humbly request you to please throw some light on to
> below written question. i will highly appreciate your efforts.
> [1] when we use C language,we use diferent library to do different thing.As
> also in your case you use module.h,init.h etc
> but how to write this library , in what language they are written in?as
> standard ANSI C ?has round about 32 keywords ?
> what should i read and learn to the related topic .
>
> AFAIK, the kernel does not involve heavy use of any library. Talking from a
> non kernel view, you know that .h files are header files. You can google
> that. The language is still C as they're C headers. What do you mean when
> you say "as standard ANSI C ?has round about 32 keywords" ?
I think his meaning is Standard ANSI C recognizes the following 32 keywords
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
int
long
register
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
Of course, as we know, kernel compilation depends on compiler "GCC"
for much more compiler extensions.
>
> please suggest something
> (I do have knowledge of Assembly).
>
> please help,this question making me beacen
> it will be honour if you reply.
> thank you
> Bhuvan Gupta
> India
>
> Cheers
> - Alex.
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
--
Best Regards
Lin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-12-23 6:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22 17:43 QUestion on C language bhuvan gupta
2010-12-22 20:33 ` Mulyadi Santosa
2010-12-22 21:31 ` Greg Freemyer
2010-12-23 4:06 ` Alex John
2010-12-23 6:54 ` Pei Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).