Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any libc project that does not requires linux kernel

Tags:

c

libc

I am using a custom user space environment that has barely no OS support: only one char device, mass storage interface and a single network socket.

To provide C programming to this platform, I need a libc. Is there any libc project that is configurable enough so that I can map low-level IO to the small API I have access to ?

AFAIK glibc and uclibc are expecting linux syscalls, so I can't use them (without trying to emulate linux syscalls, which is something I prefer to avoid).

like image 646
Laurent G Avatar asked Feb 24 '11 07:02

Laurent G


People also ask

Is libc part of Linux kernel?

Libc is user-space library, and you can't use it from kernel-space. But almost all functions from libc that make sense in kernel space are ported.

Is libc the same as glibc?

libc is a generic term used to refer to all C standard libraries -- there are several. glibc is the most commonly used one; others include eglibc, uclibc, and dietlibc.

How does libc work?

Libc will invoke the OSes drivers which invoke the virtual hardware in your emulator. For a popular example, see DosBox. The other interpretation of your question is that you don't want to write a full emulator, but a binary compatibility layer that allows you to execute mips32 binaries on a non-mips32 system.

Why is glibc needed?

Released under the GNU Lesser General Public License, glibc is free software. The GNU C Library project provides the core libraries for the GNU system, as well as many systems that use Linux as the kernel. These libraries provide critical APIs including ISO C11, POSIX. 1-2008, BSD, OS-specific APIs and more.


1 Answers

There are several different libc's to choose from, but all will need some work to integrate into your system.

  • uClibc has a list of other C libraries. The most interesting ones on that list are probably
    • dietlibc
    • newlib
  • FreeDOS has a LIBC
  • EGLIBC might be simpler to port than the "standard" glibc.
like image 112
gnud Avatar answered Sep 27 '22 20:09

gnud