Building Kernel Errors

Mark Muscat

New Member


Messages: 8

I am having trouble compiling an untouched copy of the Kernel (Generic).

I started out by adding a few print lines (uprintf) to the /usr/src/sys/dev/usb/usb_hid.c. The idea is to see the program work thoroughly when attaching a usb hid device, but that's beside the point.

However, when I try to build the Kernel (
# make buildkernel KERNCONF=[I]MYKERNEL[/I] ) I get the following two errors:

Code:
/usr/src/sys/dev/pci/pcivar.h:303:1:error: implicit declaration of function 'BUS_READ_IVAR' is invalid in C99
Code:
/usr/src/sys/dev/pci/pcivar.h:303:1:error: implicit declaration of function 'BUS_WRITE_IVAR' is invalid in C99

As I have said above I have not touched the config file of the Kernel and neither this specific file mentioned in the errors. Any ideas as to what might be causing this? Thanks

*EDIT* I have also tried building the original GENERIC version of the Kernel, with the same results.
 
Last edited by a moderator:

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,615
Messages: 37,958

Revert your changes, apparently you changed something that broke things.
 

tobik@

Daemon
Developer

Reaction score: 1,415
Messages: 1,909

*EDIT* I have also tried building the original GENERIC version of the Kernel, with the same results.
Are your kernel sources in sync with your current FreeBSD version? How did you get the sources?
 

youngunix

Active Member

Reaction score: 40
Messages: 228

BUS_READ_IVAR does not exist in (10):
  • CURRENT: /sys/dev/pci/pcivar.h #updated on Tue Aug 9
  • STABLE: /sys/dev/pci/pcivar.h #updated on Sun Jul 24
  • RELEASE: /sys/dev/pci/pcivar.h #updated on Mon Apr 4

Post the output of uname -a.
 
OP
M

Mark Muscat

New Member


Messages: 8

*UPDATE*
I have checked my FreeBSD and it is 11.0-CURRENT. As far as I know this is not the stable version. What I will do now is redownload the latest source and attempt to rebuild the Kernel (with the idea of having 11.0-Stable). Any ideas how to do this please? I know it has to do with SVN but I down't know the specific URL needed to update the/usr/src. As soon as I figure it out I will be updating this thread.

Thanks for your support.

[ Answering the questions you asked me ]

executing uname -a It outputs FreeBSD FreeBSD_Test 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r296485

Apparently, since it was not me who installed this system (our admin), it is not the stable version and I will have to update it to the 11-Stable OR Release as I have said above.

*UPDATE #2*
I created a new directory mkdir src_11_stable and downloaded the latest stable version of FreeBSD (11), using the command:

svn checkout https://svn.FreeBSD.org/base/stable/11

This downloaded the source files in the said depository (Took a while).

As soon as this was done, I built the new Kernel ( make buildkernel), having it finally successfully built.

Followed by a installation of the kernel ( make installkernel) and a reboot, the new stable FreeBSD 11.0 [PRERELEASE] is now on my system.

Hopefully this will not prompt any more problems in the future and this post will help others finding themselves in similar situations.
 

youngunix

Active Member

Reaction score: 40
Messages: 228

You need to read the following articles from the manual:
To keep things neat and organized, the source you check out should be in /usr/src. If you are planning on building ports, you need to checkout the ports tree that matches the development branch you are using.
 
Last edited by a moderator:

youngunix

Active Member

Reaction score: 40
Messages: 228

BTW, you mentioned that your "admin" is the one that installed the OS, is this a production machine or just for testing?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,615
Messages: 37,958

I created a new directory mkdir src_11_stable and downloaded the latest stable version of FreeBSD (11), using the command:

svn checkout https://svn.FreeBSD.org/base/stable/11

This downloaded the source files in the said depository (Took a while).

As soon as this was done, I built the new Kernel ( make buildkernel), having it finally successfully built.

Followed by a installation of the kernel ( make installkernel) and a reboot, the new stable FreeBSD 11.0 [PRERELEASE] is now on my system.
You need to update the whole system, not just the kernel. At the moment you have an up to date kernel with out of date userland.

Handbook: 23.6. Rebuilding World
 
OP
M

Mark Muscat

New Member


Messages: 8

BTW, you mentioned that your "admin" is the one that installed the OS, is this a production machine or just for testing?
It is for testing mainly, I am working on a virtual machine and a solo machine, on which I test my devices and programs
 
Top