# Need help building kwboot



## balanga (Jul 28, 2017)

Can someone help me build kwboot? It's probably very simple for anyone used to building programs...

I have the src and the required header 

Running  or `gcc kwboot.c` or `cc kwboot.c`produces an a.out but I'm not sure how to make an executable.  Running `make kwboot` fails with a linker error which I don't understand.


----------



## ljboiler (Jul 28, 2017)

Actually, a.out _is_ the executable.  Just rename it to kwboot and it's ready to go: `mv a.out kwboot`.

In the future,  `gcc -o <executable name> <source file>` will give you an executable with the name you want without the extra step.


----------



## balanga (Jul 28, 2017)

Actually that was a mistake

It should have been  src and the required header.

I was going to provide a script for building kwboot but I can't work out how to retrieve a file from github.... My efforts result in a file will lots of embedded html. 

Can someone show me how the retrieve this file?

https://github.com/LeMaker/u-boot/blob/master/tools/kwbimage.h


----------



## Phishfry (Jul 28, 2017)

Right click on the RAW button and save file.


----------



## balanga (Jul 28, 2017)

I meant from the command line...


----------



## Phishfry (Jul 28, 2017)

`fetch https://github.com/LeMaker/u-boot/raw/master/tools/kwbimage.h`


----------



## Phishfry (Jul 28, 2017)

fetch seems to require some authentication.
So how about you use git and pull the whole project down.
`git clone https://github.com/LeMaker/u-boot /u-boot`

This will download the entire LeMaker u-boot project to a directory on your computer named /u-boot.
You will probably need more than just header files from here.

If you don't have git installed on your computer download it with `pkg install git`.


----------



## balanga (Jul 29, 2017)

```
wget https://github.com/LeMaker/u-boot/raw/master/tools/kwboot.c
wget https://github.com/LeMaker/u-boot/raw/master/tools/kwbimage.h
gcc -o kwboot kwboot.c
```


----------



## balanga (Jul 31, 2017)

Whilst it builds OK it doesn't actually work as expected... I had to resort to using a Linux version on Ubuntu -


----------



## balanga (Oct 12, 2017)

Can anyone suggest how to go about debugging kwboot to see why it doesn't work on FreeBSD?


----------



## balanga (Oct 25, 2017)

In the absence of any replies, can I simply add a 'printf(hello, world)' type statement somewhere in main() in 

https://raw.githubusercontent.com/LeMaker/u-boot/master/tools/kwboot.c

and expect to see some output?


----------

