Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build ethtoolc #43

Closed
afrantisak opened this issue Nov 22, 2018 · 11 comments
Closed

How to build ethtoolc #43

afrantisak opened this issue Nov 22, 2018 · 11 comments

Comments

@afrantisak
Copy link

I would like to build ethtoolc.c and some of the other apps but they won't build from app.sh or the makefile in Examples or even using the instructions in the top of the source file. I just need some pointers/general direction on where to start. I naively tried the following based on the comments in the source file:

gcc -c -m64 -nostdlib -nostartfiles -nodefaultlibs -o ethtoolc.o ethtoolc.c -I ../../output/include -I ../
gcc -c -m64 -nostdlib -nostartfiles -nodefaultlibs -o libBareMetal.o libBareMetal.c
ld -T example.ld -o ethtoolc.app ethtoolc.o libBareMetal.o  -L ../../output/lib -L ../../output/x86_64-pc-baremetal/lib/ -lc -lbmfs -L ../Alloy/lib -lalloy

but where do I get definitions for b_output, et. al.?

ethtoolc.o: In function `main':
ethtoolc.c:(.text+0x17): undefined reference to `b_output'
ethtoolc.c:(.text+0x17): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_output'
ethtoolc.c:(.text+0x2b): undefined reference to `b_system_config'
ethtoolc.c:(.text+0x2b): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_system_config'
ethtoolc.o: In function `ethtool_send':
ethtoolc.c:(.text+0xc7): undefined reference to `b_ethernet_tx'
ethtoolc.c:(.text+0xc7): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_ethernet_tx'
ethtoolc.o: In function `ethtool_receive':
ethtoolc.c:(.text+0x101): undefined reference to `b_ethernet_rx'
ethtoolc.c:(.text+0x101): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `b_ethernet_rx
@afrantisak
Copy link
Author

FYI the goal here is to write a tcp server so if this is the wrong way to go about it let me know... thanks!

@IanSeyler
Copy link
Member

All of the old apps need to be revisited as a few things have changed around in the kernel. As for a TCP server running on BareMetal I have this working via https://github.com/IanSeyler/minIP

@afrantisak
Copy link
Author

I built minIP, (default standalone) installed and ran but it just hangs without any output. The other apps on the image such as hello.c and sysinfo work.
In general to convert the old apps, what is the procedure?
Does it make sense to try to port a stack such as FreeRTOS TCP stack?

@IanSeyler
Copy link
Member

Thanks for that info. I have some serious cleanup to do as the kernel API changed around a bit. I will try to take a look at this over the weekend.

It might be worth the try to port something. The concern is what the stack depends on. An older version of lwIP (https://github.com/ReturnInfinity/BareMetal-lwIP) was ported successfully in the past.

@IanSeyler
Copy link
Member

Yeah - minIP is using an older kernel API so I have some changes to make.

@ghost
Copy link

ghost commented Nov 23, 2018

@IanSeyler I think I'll be able to fix this later today

@IanSeyler
Copy link
Member

IanSeyler commented Nov 23, 2018

@tay10r Don't worry about it for the moment. I'm in the middle of cleaning up some stuff over on GitLab. Once that is done I will make the GitHub repos for the kernel and Pure64 read-only.

minIP on GitLab uses the newer kernel API.

@ghost
Copy link

ghost commented Nov 23, 2018

Oh okay gotcha

@IanSeyler
Copy link
Member

A bunch of the repos here on GitHub are now archived(read only). As I verify the old test apps still work (or fix them) they will be added to GitLab.

@IanSeyler
Copy link
Member

@afrantisak I have a working version of ethtoolc.c (now called ethtest.c) here:
https://gitlab.com/ianseyler/BareMetal-test/blob/master/ethtest.c

@IanSeyler
Copy link
Member

minIP works as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants