# How do I compile the source code?



## GafiQ (Jul 15, 2020)

Hello! I'm a programmer and I tried to tinker around with FreeBSD's source code and try to understand it.

I would like to know, How can I test a change I made?

I don't know if I got the terminology right (I usually use python), but I believe I need to "compile it" and would like to know how to do so.

Do I turn the source code into a bootable image like an ISO? If so, how? Or do I need something else?

this is the original code I worked with: https://github.com/freebsd/freebsd


----------



## SirDice (Jul 15, 2020)

GafiQ said:


> I don't know if I got the terminology right (I usually use python), but I believe I need to "compile it" and would like to know how to do so.


Yes, C code is compiled. It does need to do a few other things too, like linking. Going from a source code file to a working executable actually  takes multiple steps. It takes even more steps to produce a bootable image. Luckily most of that process is automated. 



GafiQ said:


> Do I turn the source code into a bootable image like an ISO?


You should start by getting familiar with the build(7) process. Once you're comfortable building what we call "world" and the kernel you can take a look at building your own release(7). Don't try to run before you've learned how to walk.


----------



## GafiQ (Jul 15, 2020)

SirDice said:


> Yes, C code is compiled. It does need to do a few other things too, like linking. Going from a source code file to a working executable actually  takes multiple steps. It takes even more steps to produce a bootable image. Luckily most of that process is automated.
> 
> 
> You should start by getting familiar with the build(7) process. Once your comfortable building what we call "world" and the kernel you can take a look at building your own release(7). Don't try to run before you've learned how to walk.


thx i'll check it out!


----------



## Mjölnir (Jul 15, 2020)

GafiQ said:


> Hello! I'm a programmer and I tried to tinker around with FreeBSD's source code and try to understand it.


Install a FreeBSD VM in your running Mac/Linux/Windows system.  A bare, basic text mode system w/ some useful utilities added is fully sufficient.  E.g. `pkg install {de,en}-freebsd-doc` (replace _de_ w/ your native tongue), editors/vim, misc/mc (Midnight Commander) & www/links (or lynx).  Then read & explore /usr/src.


> I would like to know, How can I test a change I made?


RTFM build(7) and RTFM _FreeBSD Handbook_.


> I don't know if I got the terminology right (I usually use python), but I believe I need to "compile it" and would like to know how to do so.


Uh, you seem to be lacking some basics here.  Search for an introduction on SW-development & Computer Science.
EDIT there's no hebrew translation for the freebsd-doc.  Should you speak russian, you can install that one.  The english version is the most timely one, anyway.


----------

