Open viktormadarasz opened 4 years ago
Sadly the person who made this only made it for FreeBSD, kinda odd as linux would be a good platform for something like this
I needed a quick and dirty ethernet driver that worked on my Mac OS X machine so I wrote one using BPF.
It does work on the BSD's, including NetBSD and FreeBSD however (probably OpenBSD as well)
It does need some work to work in Linux, the Linux implementation of BPF requires different functions for opening the capture among other things (getting around the uint errors is trivial, just include stdint.h somewhere near the top of the file). . It's not impossible to just #ifdef your way around it but it requires some knowledge of how the Linux BPF implementation works.
It might actually be easier to hack it around using libpcap so that it works using that on all of the OS's than to include specific code for both Linux and the BSD for their different BPF implementations. I might take a look at that at some point
It's also pretty ugly without using software interrupts for one (it works, but either wastes cycles or is slow)
Kind regards, Sigurbjörn
On 19 Jun 2021, at 21:53, agithubuser444 @.***> wrote:
Sadly the person who made this only made it for FreeBSD, kinda odd as linux would be a good platform for something like this
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lisper/emulator-sun-2/issues/3#issuecomment-864468263, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBSMVGXKH76OUVT5GYY7ULTTUGXJANCNFSM4OAZHZJA.
@sigurbjornl just curious, can you make a tutorial on how to do this, i would need some help on trying to do this as i am on Arch Linux.
I ran into the Linux-BPF problem as well. Maybe I'll take a look at it. The libpcap route is interesting.
I made a pull request that might fix this issue: #9
Thanks a lot
will give it a try again
Viktor Madarasz
From: Stefanos Stefanidis @.> Sent: Sunday, May 28, 2023 7:19:24 PM To: lisper/emulator-sun-2 @.> Cc: Viktor Madarasz @.>; Author @.> Subject: Re: [lisper/emulator-sun-2] Trying to build on Fedora 32 throws me this error (i defined my network interface in 3c400.c) (#3)
I made a pull request that might fix this issue: #9https://github.com/lisper/emulator-sun-2/pull/9
— Reply to this email directly, view it on GitHubhttps://github.com/lisper/emulator-sun-2/issues/3#issuecomment-1566204498, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACKMTTRZJGQ7ESIIF3MVAO3XIOCJZANCNFSM4OAZHZJA. You are receiving this because you authored the thread.Message ID: @.***>
Any updates?
As a work-around I just run it in a ghostbsd VM on Linux.
[root@fedoraws emulator-sun-2]# make make -C m68k all make[1]: Entering directory '/home/viktormadarasz/emulator-sun-2/m68k' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/viktormadarasz/emulator-sun-2/m68k' make -C sim all make[1]: Entering directory '/home/viktormadarasz/emulator-sun-2/sim' Makefile:19: extraneous text after 'else' directive cc -c -I. -I../m68k -I/usr/pkg/include -g -O2 -DM68K_V33 sim68k.c In file included from sim68k.c:28: sim.h:44:1: error: unknown type name ‘uint32_t’; did you mean ‘u_int32_t’? 44 | uint32_t e3c400_read(uint32_t addr, int32_t size); | ^
~~~ | u_int32_t sim.h:44:22: error: unknown type name ‘uint32_t’; did you mean ‘u_int32_t’? 44 | uint32_t e3c400_read(uint32_t addr, int32_t size); | ^~~~ | u_int32_t sim.h:45:19: error: unknown type name ‘uint32_t’; did you mean ‘u_int32_t’? 45 | void e3c400_write(uint32_t addr, uint32_t size, uint32_t value); | ^~~~ | u_int32_t sim.h:45:34: error: unknown type name ‘uint32_t’; did you mean ‘u_int32_t’? 45 | void e3c400_write(uint32_t addr, uint32_t size, uint32_t value); | ^~~~ | u_int32_t sim.h:45:49: error: unknown type name ‘uint32_t’; did you mean ‘u_int32_t’? 45 | void e3c400_write(uint32_t addr, uint32_t size, uint32_t value); | ^~~~ | u_int32_t sim68k.c: In function ‘io_read’: sim68k.c:212:13: warning: implicit declaration of function ‘e3c400_read’ [-Wimplicit-function-declaration] 212 | value = e3c400_read(pa, size); | ^~~sim68k.c: In function ‘cpu_write_mbmem’: sim68k.c:693:5: warning: implicit declaration of function ‘e3c400_write’; did you mean ‘e3c400_init’? [-Wimplicit-function-declaration] 693 | e3c400_write(address, size, value); | ^~~~ | e3c400_init make[1]: [Makefile:47: sim68k.o] Error 1 make[1]: Leaving directory '/home/viktormadarasz/emulator-sun-2/sim' make: [GNUmakefile:4: all] Error 2 [root@fedoraws emulator-sun-2]#Tried both with and without root account it throws the same issue also with make or gmake as well