# kernel



## XTime (Nov 10, 2019)

where is the location of  kernel file for freebsd in the source code?


----------



## stratact (Nov 10, 2019)

You mean the kernel configuration files? That would be in /usr/src/sys/<arch>/conf, where <arch> is your CPU platform.

For more information


----------



## XTime (Nov 12, 2019)

I don't mean kernel configuration files, i mean the real kernel source code written in C programming language


----------



## SirDice (Nov 12, 2019)

You seem to think it's a single source file. The kernel can be found in /usr/src/sys/.


----------



## XTime (Nov 12, 2019)

There is a folder in /usr/src/sys called kern and libkern are they the ones.


----------



## SirDice (Nov 12, 2019)

No, _everything_ in /usr/src/sys is the kernel code.

What exactly are you looking for?


----------



## XTime (Nov 12, 2019)

the kernel code and i want to redesign the code


----------



## SirDice (Nov 12, 2019)

XTime said:


> i want to redesign the code


Which part and why?


----------



## XTime (Nov 12, 2019)

NetBSD -> monolithic + rump 
DragonflyBSD -> Hybrid
OpenBSD -> monolithic
FreeBSD-> monolithic


----------



## XTime (Nov 12, 2019)

What is the location of network stack?


----------



## SirDice (Nov 12, 2019)

XTime said:


> DragonflyBSD -> Hybrid


I don't think that's correct. DragonFly is based on FreeBSD 4.8 and although they've changed quite a lot over the years it is still a monolithic kernel. 



XTime said:


> What is the location of network stack?


What part? sys/netinet, sys/netinet6, sys/netipsec?


----------



## XTime (Nov 12, 2019)

SirDice said:


> I don't think that's correct. DragonFly is based on FreeBSD 4.8 and although they've changed quite a lot over the years it is still a monolithic kernel.
> 
> 
> What part? sys/netinet, sys/netinet6, sys/netipsec?


so these parts make freebsd to connect to the internet


----------



## stratact (Nov 12, 2019)

XTime said:


> NetBSD -> monolithic + rump
> DragonflyBSD -> Hybrid
> OpenBSD -> monolithic
> FreeBSD-> monolithic



Why do I get the feeling you're trying to adapt the FreeBSD kernel into a microkernel?


----------



## SirDice (Nov 12, 2019)

stratact said:


> Why do I get the feeling you're trying to adapt the FreeBSD kernel into a microkernel?


I had the same feeling. Good luck with that, it's easier said than done. Many have tried already.

I'm still surprised by the number of people that have no experience with FreeBSD and wanting to "revolutionize" or "redesign" everything. You rarely hear from them again.


----------



## XTime (Nov 12, 2019)

I started toying with FreeBSD since 2012 starting with FreeBSD 9.0, I am using Fedora Linux as I ran away from Microsoft Windows tyranny. I also tried many times to play around by installing PCBSD. I actually got a taste of open source in 2009 by Fedora Linux 10. FreeBSD is powerful and stable.


----------



## SirDice (Nov 12, 2019)

XTime said:


> I started toying with FreeBSD since 2012 starting with FreeBSD 9.0


You should beg, steal or borrow a copy of "The design and implementation of the FreeBSD Operating System". Make sure to get the second edition, the first edition only covers up to FreeBSD 5.


----------



## XTime (Nov 12, 2019)

I will buy it


----------



## shkhln (Nov 12, 2019)

Get some book about programing in general, the most basic stuff.


----------



## XTime (Nov 12, 2019)

i have a books on nasm, gnu assembler. i also three books on c programming language, python, "flex and bison"


----------



## stratact (Nov 12, 2019)

I can see you're very passionate and that's very admirable. However I don't think continuing the discussion here will help you any. I suggest going over to the mailing list and talking with the FreeBSD developers about your goals and desires. You will get much more insight there.


----------



## shkhln (Nov 12, 2019)

XTime said:


> i have a books on nasm, gnu assembler. i also three books on c programming language, python, "flex and bison"



So, how much of a newbie are you? Do you understand the difference between a linked list and a tree, for example?



stratact said:


> I suggest going over to the mailing list and talking with the FreeBSD developers about your goals and desires. You will get much more insight there.



This kind of question would be either completely ignored or trolled to death.


----------



## stratact (Nov 12, 2019)

> This kind of question would be either completely ignored or trolled to death.



I see. Forgive me. Ignore my suggestion XTime.


----------



## XTime (Nov 12, 2019)

There is no harm in your suggestion. Linked list are hard because the recent C Programming language book i had been using , i discovered later that it was about programming on microsoft windows☹ not on any unix system.


----------



## XTime (Nov 12, 2019)

A Tree is a node created with pointers and structures e.g

typedef struct node node;
struct node
{
   int init_node;

  node  *pNode;
}

pNode-> X.init_node;

y = malloc(pNode, sizeof(pNode)) ;


----------



## Deleted member 30996 (Nov 12, 2019)

XTime said:


> I will buy it



Or not.









						wozhifei/books
					

study. Contribute to wozhifei/books development by creating an account on GitHub.




					github.com


----------



## XTime (Nov 12, 2019)

I prefer a hardcopy because softcopies are eye straining and can be disturbing due to gui


----------



## shkhln (Nov 12, 2019)

Maybe you would like some of Allen B. Downey's books: https://greenteapress.com/wp/. As usual with my book recommendations, I haven't read them myself, but they are supposedly very decent.


----------



## ralphbsz (Nov 13, 2019)

So, you want to do kernel programming. Great.

That means you have to first seriously learn C. Write at least 10,000 lines of functioning C code. Get it reviewed and critiqued by experts. Make sure it's production worthy. This will probably take you half a year, working 20% of your time. Sorry, but owning one book is just a tiny step into a very long voyage there.

Then learn about the kernel. Read the book SirDice recommended, and understand it. Ask someone to give you a little quiz, and make sure you can do the quizzes. Honestly, I would also read a good undergraduate operating systems textbook, like Tanenbaum, and do the homework problems. That's like taking a 1-semester undergraduate OS class; again 20% of your time for half a year.

You want to work on the network part? For that, you need to understand how networking works. The fact that you ask "the part that connects to the internet" shows that you have no clue about that. There are oodles of TCP/IP books. Get one, understand it.

Once you have done these things, the question of "where is the source code" will be irrelevant, and you will know the answer.

I don't think you even understand the complexity of the question you have asked.


----------



## XTime (Nov 13, 2019)

I have used programming in C Book, Beginning C book


----------



## XTime (Nov 13, 2019)

I also have a book on Networking


----------



## stratact (Nov 13, 2019)

XTime, we think it's cool you want to be a kernel developer. There is no doubt there, we want you to be one.

However, we are kindly showing you that you are missing a critical point in our advice to you. This is a *god-tier* level of work and skill.

Saying that you own some books is not enough. It does not say how capable you are.

You have to prove you have a fundamental understanding in computer science (like data structures), proof on working in a serious C project or two (like maybe from github), and understanding core OS and Networking concepts.

This is quite the huge jump and we all care that you care, but we do not think you understand what you are jumping into.

Don't say I have book X or Y. Either say "I will learn this to the best of my abilities" or show you actually know something if you do


----------



## shkhln (Nov 13, 2019)

stratact said:


> This is a *god-tier* level of work and skill.



I wouldn't necessarily put it that way. There are plenty of challenging things outside of kernel development (say, databases) and, conversely, not every kernel subsystem is a complicated mess. If you are a competent programmer with an unhealthy inclination for writing low level code, you certainly can find something to work on, no superhuman skills required.


----------



## XTime (Nov 13, 2019)

I can't say you are right or i can't say you are wrong


----------

