{"id":10,"date":"2006-11-03T09:19:32","date_gmt":"2006-11-03T07:19:32","guid":{"rendered":"http:\/\/lallafa.de\/blog\/??p=10"},"modified":"2006-11-03T09:19:32","modified_gmt":"2006-11-03T07:19:32","slug":"tfe-on-mac-vice-build-guide","status":"publish","type":"post","link":"https:\/\/lallafa.de\/blog\/2006\/11\/tfe-on-mac-vice-build-guide\/","title":{"rendered":"TFE on Mac VICE Build Guide"},"content":{"rendered":"<p>The Final Ethernet (TFE) adapter allows to connect a real Commodore 64 to the ethernet. VICE can emulate this adapter and makes your virtual C64 internet-aware. This guide describes how to compile a TFE-enabled version of the mac port.<\/p>\n<p><!--more--><\/p>\n<p>You need to compile and setup the <strong>libpcap<\/strong> and <strong>libnet<\/strong> libraries before compiling VICE.<\/p>\n<h3>libpcap<\/h3>\n<ul>\n<li>Download lipcap from <a href=\"http:\/\/www.tcpdump.org\">www.tcpdump.org<\/a><\/li>\n<li>I use version 0.9.5<\/li>\n<li>Compile a universal library with the following commands\n<pre>\n# build i386 version\nexport CFLAGS=\"-arch i386 -isysroot \/Developer\/SDKs\/MacOSX10.4u.sdk\/\"\n.\/configure\nmake\ncp libpcap.a libpcap-i386.a\n\nmake distclean\n\n# build ppc version\nexport CFLAGS=\"-arch ppc -isysroot \/Developer\/SDKs\/MacOSX10.3.9.sdk\/\"\n.\/configure\nmake\ncp libpcap.a libpcap-ppc.a\n\n# combine universal lib\nlipo -create -output libpcap.a libpcap-i386.a libpcap-ppc.a\nranlib libpcap.a\n<\/pre>\n<\/li>\n<\/ul>\n<h3>libnet<\/h3>\n<ul>\n<li>You need version 1.0.x, 1.1.x won&#8217;t work!\n<li>The homepage of libnet is <a href=\"http:\/\/www.packetfactory.net\/libnet\/\">www.packetfactory.com<\/a><\/li>\n<li>I grabbed my lib source from Debian because the homepage was down:<br \/>\n<a href=\"http:\/\/ftp.debian.org\/debian\/pool\/main\/libn\/libnet0\/libnet0_1.0.2a.orig.tar.gz\">http:\/\/ftp.debian.org\/debian\/pool\/main\/libn\/libnet0\/libnet0_1.0.2a.orig.tar.gz<\/a>\n<\/li>\n<li>Libnet 1.0 is very old and needs an updated configure:\n<pre>\ncd libnet0_1.0.2a\ncp \/usr\/share\/libtool\/config.guess .\ncp \/usr\/share\/libtool\/config.sub .\n<\/pre>\n<\/li>\n<li>Additionally a small patch is required to compile the source with the 10.4 SDK. In file <strong>include\/libnet\/libnet-headers.h<\/strong> find the line\n<pre>\n#if (__linux__)<\/pre>\n<p> and replace it with<\/p>\n<pre>#if (__linux__) || (defined(__APPLE__)&&defined(__i386__))<\/pre>\n<\/li>\n<li>Compile a universal library with the following commands:\n<pre>\n# build i386 version\nexport CFLAGS=\"-arch i386 -isysroot \/Developer\/SDKs\/MacOSX10.4u.sdk\/\"\n.\/configure\nmake CFLAGS=\"$CFLAGS\"\ncp lib\/libnet.a lib\/libnet-i386.a\n\n# build ppc version\nexport CFLAGS=\"-arch ppc -isysroot \/Developer\/SDKs\/MacOSX10.3.9.sdk\/\"\n.\/configure\nmake CFLAGS=\"$CFLAGS\"\ncp lib\/libnet.a lib\/libnet-ppc.a\n\n# combine universal lib\nlipo -create -output lib\/libnet.a lib\/libnet-i386.a lib\/libnet-ppc.a\nranlib lib\/libnet.a\n<\/pre>\n<\/li>\n<\/ul>\n<h3>Compiling VICE<\/h3>\n<ul>\n<li>Link both libs named <strong>libpcap<\/strong> and <strong>libnet<\/strong> in the same directory where the VICE source resides:\n<pre>\nlibpcap\nlibnet\nvice-1.20\n<\/pre>\n<\/li>\n<li>Configure VICE with the following commands:\n<pre>\nPWD=`pwd`\ncd vice-1.20\nexport PATH=$PWD\/libnet:$PATH\nexport CFLAGS=\"-I$PWD\/libpcap -I$PWD\/libnet\/include\"\nexport CPPFLAGS=\"$CFLAGS\"\nexport LDFLAGS=\"-L$PWD\/libpcap -L$PWD\/libnet\/lib\"\n.\/configure --enable-ethernet\n<\/pre>\n<\/li>\n<li>Have a look at the configure output and make sure the following lines are both true:\n<pre>\nchecking for pcap_open_live in -lpcap... yes\nchecking for libnet_write_link_layer in -lnet... yes\n<\/pre>\n<\/li>\n<li>Now compile and build VICE as usual:\n<pre>\nmake\nmake bindist\n<\/pre>\n<\/li>\n<\/ul>\n<h3>Setup Mac OS X for libpcap<\/h3>\n<ul>\n<li>For libpcap and thus VICE with TFE to work correctly on Mac OS X you need to set up the raw net devices <em>\/dev\/bpf*<\/em> with the correct permissions. See the document in <strong>libpcap\/README.macosx<\/strong> for more details!<\/li>\n<li>You need to install the following StartupItem and reboot your machine:\n<pre>\ncd libpcap\nmkdir -p \/Library\/StartupItems\/\nsudo cp -r ChmodBPF \/Library\/StartupItems\/\n<\/pre>\n<\/li>\n<li>After a reboot the devices should be read\/writable by the admin group:\n<pre>\ncrw-rw----   1 root  admin   23,   0 Nov  1 16:55 \/dev\/bpf0\ncrw-rw----   1 root  admin   23,   1 Nov  1 16:54 \/dev\/bpf1\ncrw-rw----   1 root  admin   23,   2 Nov  1 16:54 \/dev\/bpf2\ncrw-rw----   1 root  admin   23,   3 Nov  1 16:54 \/dev\/bpf3\n<\/pre>\n<\/li>\n<li>Make sure that you are in the admin group, i.e. your user is allowed to manage the system!<\/li>\n<\/ul>\n<h3>Running VICE<\/h3>\n<ul>\n<li>Run your compiled <em>x64.app<\/em>\n<li>In the VICE menu <strong>IO Extensions<\/strong> there should now exist a <strong>Ethernet emulation<\/strong> entry.<\/li>\n<li>Select <em>IO Extensions\/Ethernet emulation\/Interface&#8230;<\/em> and enter your Mac&#8217;s ethernet interface, e.g. I use <strong>en1<\/strong> for my AirPort card. If you are not sure what to pick, just have a look at your ifconfig output. There the ethernet device are listed with their assigned IPs.<\/li>\n<li>Now you can enable the TFE with <em>IO Extensions\/Ethernet emulation\/Enable Ethernet<\/em><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Final Ethernet (TFE) adapter allows to connect a real Commodore 64 to the ethernet. VICE can emulate this adapter and makes your virtual C64 internet-aware. This guide describes how to compile a TFE-enabled version of the mac port.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-vice-on-mac"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/piBMF-a","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":0,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"wp:attachment":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}