How to compile in C language written kernel?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
kilimindzharo
Posts: 3
Joined: Sat Jan 30, 2010 9:10 am

How to compile in C language written kernel?

Post by kilimindzharo »

I'm wondering how to compile in C language written kernel?
skyking
Member
Member
Posts: 174
Joined: Sun Jan 06, 2008 8:41 am

Re: How to compile in C language written kernel?

Post by skyking »

Why not check out the wiki, fx Getting Started.
kilimindzharo
Posts: 3
Joined: Sat Jan 30, 2010 9:10 am

Re: How to compile in C language written kernel?

Post by kilimindzharo »

skyking wrote:Why not check out the wiki, fx Getting Started.
I only found how to compile simply files such as exe, com etc, but I need to compile it to bin file. How do i do that?
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: How to compile in C language written kernel?

Post by xenos »

Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: How to compile in C language written kernel?

Post by neon »

Compiling a C kernel isnt any different then compiling programs. EXE, ELF both can be used. I personally dont recommend BIN kernels but they can also be used with some additional software (like binutils)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Locked