Trying to compile the tap driver source code

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
ronnie173
OpenVpn Newbie
Posts: 1
Joined: Sun Oct 23, 2011 6:36 pm

Trying to compile the tap driver source code

Post by ronnie173 » Sun Oct 23, 2011 7:06 pm

Hi anyone know how to compile the source code of the tap driver? I am trying to edit some code in there to make the tap driver update the users internet connection icon to display a connected status.

nickfrost
OpenVpn Newbie
Posts: 2
Joined: Tue Jan 17, 2012 5:27 pm

Re: Trying to compile the tap driver source code

Post by nickfrost » Tue Jan 17, 2012 5:55 pm

I was compiling the TUN/TAP driver and bumped into problems getting it to work in Solaris 10 on SPARC64.

After much searching, I found the solution at http://openvpn.net/archive/openvpn-user ... 00254.html.

The important parts are (edited a bit):

# Sun Studio targetting 64 bit SPARC
% cc -D_KERNEL -xarch=v9 -c tun.c
# Sun Studio targetting 64 bit x86
%cc -D_KERNEL -xarch=amd64 -xmodel=kernel -c tun.c
# Sun Studio targetting 32 bit
% cc -D_KERNEL -c tun.c
# GNU C Compiler targetting 64 bit SPARC ( optional: mtune=ultrasparc -O2 )
% gcc -D_KERNEL -m64 -mcpu=v9 -mcmodel=medlow -fno-pic -mno-fpu -ffreestanding -nodefaultlibs -c tun.c
# GNU C Compiler targetting 64 bit x86 ( optional: mtune=opteron -O2 )
% gcc -D_KERNEL -m64 -mcmodel=kernel -mno-red-zone -ffreestanding -nodefaultlibs -c tun.c
# GNU C Compiler targetting 32 bit
% gcc -D_KERNEL -ffreestanding -nodefaultlibs -c tun.c

The linking is the same for all
% usr/ccs/bin/ld -r -o tun tun.o

The destination is different depending on the architecture:
# 64 bit sparc
cp tun /usr/kernel/drv/sparcv9/tun
# 64 bit x86
cp tun /usr/kernel/drv/amd64/tun
# 32 bit
cp tun /usr/kernel/drv/tun

Post Reply