Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
5
votes
1
answers
4477
views
Networking and Samba from a quest OS running on qemu
I'm trying to test some software on a big endian system to ensure compatibility. My plan is to use qemu on Ubuntu 12.04 to emulate a MIPS system. So far I've been able to create the quest system successfully, but I haven't been able to network it with the host system. I can access the outside world...
I'm trying to test some software on a big endian system to ensure compatibility. My plan is to use qemu on Ubuntu 12.04 to emulate a MIPS system. So far I've been able to create the quest system successfully, but I haven't been able to network it with the host system. I can access the outside world from the guest system (e.g. wget or apt-get), but my attempts at setting up samba have failed.
According to this , in QEmu 1.1 and newer the network bridge helper can set tun/tap up for you without the need for additional scripting. I'm trying to use that since I've seen different versions of the scripts. Right now
qemu-system-mips -version
reports the following:
QEMU emulator version 1.0.50 (Debian 1.0.50-2012.03-0ubuntu2.1), Copyright (c) 2003-2008 Fabrice Bellard
I've compiled from the 1.4.1 source and used the version from apt-get
. Both report the same thing. I'm working under the assumption that I have version 1.1 or later despite what -version
is telling me. Anyway, the next instruction was to turn on the setuid attribute for the default network helper:
sudo chmod u+s /usr/local/libexec/qemu-bridge-helper
Next I created a bridge.conf
file in /etc/qemu/
and /usr/local/etc/qemu
with -rw-r--r--
for permissions. The contents of the file are:
allow br0
If I start QEmu with the following command:
qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -net nic -net bridge,br=br0 -smb /home/uli/samba
or with
qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -netdev bridge,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1
or with
qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -netdev tap,helper=/usr/local/libexec/qemu-bridge-helper,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1
I get the following error:
failed to get mtu of bridge `br0': No such device
failed to launch bridge helper
qemu-system-mips: -net bridge,br=br0: Device 'bridge' could not be initialized
Fair enough, I didn't create the br0 bridge. I've tried creating one with a script I don't understand, but then my quest MIPS QEmu system no longer connects to anything. It sees br0, but it doesn't get an IP address. Clearly I'm doing something wrong here:
ifconfig br0 down
brctl delbr br0
ifconfig eth2 0.0.0.0 promisc up
brctl addbr br0
brctl setfd br0 0
brctl addif br0 eth2
echo 1 > /proc/sys/net/ipv4/conf/br0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth2/proxy_arp
echo 1 > /proc/sys/net/ipv4/ip_forward
dhclient br0
ifconfig br0 up
Is there an easier way to do this? Personally, I would be fine just using the SMB server on \\10.0.2.4\qemu that's described here , but that hasn't worked for me either (115 errors when I try to mount the share, presumably because of networking trouble).
**Update**
Once I create the bridge, I see the following output from ifconfig on the host machine:
br0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:10.2.32.101 Bcast:10.2.32.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:85 errors:0 dropped:0 overruns:0 frame:0
TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8235 (8.2 KB) TX bytes:9227 (9.2 KB)
eth2 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:196581 errors:0 dropped:0 overruns:0 frame:0
TX packets:44205 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:139517339 (139.5 MB) TX bytes:3365206 (3.3 MB)
Checking the brctl show
output, I see the following:
bridge name bridge id STP enabled interfaces
br0 8000.XXXXXXXXXXXX no eth2
Now I start the quest system in QEmu. If I run ifconfig, I see the following:
eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:536 errors:1 dropped:51 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:55083 (53.7 KiB) TX bytes:2862 (2.7 KiB)
Interrupt:10 Base address:0x1020
And the bridge looks like this:
bridge name bridge id STP enabled interfaces
br0 8000.XXXXXXXXXXXX no eth2
tap0
Unfortunately with this setup, the quest system has lost the limited "user mode" networking it once had (i.e. wget and apt-get no longer work). The only IP address I see is for the bridge, so I'm not sure how the quest will appear on the network. The host still appears, at the same IP address as br0.
**Update**
Here is the output from iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
GrandAdmiral
(181 rep)
Apr 30, 2013, 09:06 PM
• Last activity: Jun 5, 2025, 11:03 PM
0
votes
1
answers
3343
views
Install Debian on Mikrotik RB 2011 routerboard
Is there any way to install Debian sid on Mikrotik RB 2011? Seems to Debian MIPS port not support this type of cpu (Atheros 600MHz 74K MIPS big-endian), I already install OpenWRT on this device, need to install Debian. List of Debian images: https://d-i.debian.org/daily-images/ Debian MIPS port: htt...
Is there any way to install Debian sid on Mikrotik RB 2011?
Seems to Debian MIPS port not support this type of cpu (Atheros 600MHz 74K MIPS big-endian), I already install OpenWRT on this device, need to install Debian.
List of Debian images: https://d-i.debian.org/daily-images/
Debian MIPS port: https://www.debian.org/ports/mips/
SINA GH
(11 rep)
Aug 16, 2020, 06:05 AM
• Last activity: Apr 14, 2025, 09:02 AM
1
votes
1
answers
138
views
Failed to run some functions with perf tool in embedded Linux
I am working on an embedded Linux system (kernel-5.19.20), and I tried the perf tool in my SOC, found some functions did NOT work. After run `perf record /test/perf_test`, I got the `perf.data`, and `perf report` also showed functions list. I cross-compiled `objdump` and `addr2line` for my target, t...
I am working on an embedded Linux system (kernel-5.19.20), and I tried the perf tool in my SOC, found some functions did NOT work.
After run
perf record /test/perf_test
, I got the perf.data
, and perf report
also showed functions list.
I cross-compiled objdump
and addr2line
for my target, then I ran
./perf annotate --addr2line /data/addr2line --objdump /data/objdump
Percent | Source code & Disassembly of perfload for cpu-clock:ppp (33248 samples, percent: local period)
--------------------------------------------------------------------------------------------------------------
:
:
:
: 3 Disassembly of section .text:
:
: 5 0040060c :
: 6 workload2():
0.00 : 40060c: addiu sp,sp,-24
0.00 : 400610: sw s8,20(sp)
0.00 : 400614: move s8,sp
0.00 : 400618: sw zero,12(s8)
0.00 : 40061c: sw zero,8(s8)
0.00 : 400620: b 400698
0.00 : 400624: nop
39.08 : 400628: lw v1,8(s8)
0.00 : 40062c: lw v0,8(s8)
2.07 : 400630: mul v0,v1,v0
0.00 : 400634: lw v1,12(s8)
4.08 : 400638: addu v0,v1,v0
0.00 : 40063c: sw v0,12(s8)
....
Then I tried to make a flamegraph with perf.data
with following commands.
perf script -i perf.data &> perf.unfold
cat perf.unfold | head -20
perfload 1822 1443.361889: 250000 cpu-clock:ppp: 80769534 _raw_spin_unlock+0x3c ([kernel.kallsyms])
perfload 1822 1443.362138: 250000 cpu-clock:ppp: 77eb6a28 __mips_syscall5+0x8 (/lib/ld-linux-mipsn8.so.1)
perfload 1822 1443.362388: 250000 cpu-clock:ppp: 800fe1e0 filemap_map_pages+0x118 ([kernel.kallsyms])
perfload 1822 1443.362639: 250000 cpu-clock:ppp: 77eb75f8 memcpy+0x1c8 (/lib/ld-linux-mipsn8.so.1)
perfload 1822 1443.362945: 250000 cpu-clock:ppp: 800eec8c perf_event_mmap_output+0x218 ([kernel.kallsyms])
perfload 1822 1443.363196: 250000 cpu-clock:ppp: 8001ec38 enable_restore_fp_context+0x208 ([kernel.kallsyms])
perfload 1822 1443.363440: 250000 cpu-clock:ppp: 4005d0 workload1+0x80 (/data/perfload)
perfload 1822 1443.363690: 250000 cpu-clock:ppp: 400584 workload1+0x34 (/data/perfload)
perfload 1822 1443.363939: 250000 cpu-clock:ppp: 4005e8 workload1+0x98 (/data/perfload)
perfload 1822 1443.364189: 250000 cpu-clock:ppp: 4005ec workload1+0x9c (/data/perfload)
perfload 1822 1443.364439: 250000 cpu-clock:ppp: 4005ec workload1+0x9c (/data/perfload)
perfload 1822 1443.364689: 250000 cpu-clock:ppp: 400594 workload1+0x44 (/data/perfload)
perfload 1822 1443.364939: 250000 cpu-clock:ppp: 400588 workload1+0x38 (/data/perfload)
perfload 1822 1443.365189: 250000 cpu-clock:ppp: 400574 workload1+0x24 (/data/perfload)
perfload 1822 1443.365439: 250000 cpu-clock:ppp: 4005d4 workload1+0x84 (/data/perfload)
perfload 1822 1443.365689: 250000 cpu-clock:ppp: 40058c workload1+0x3c (/data/perfload)
perfload 1822 1443.365939: 250000 cpu-clock:ppp: 40058c workload1+0x3c (/data/perfload)
perfload 1822 1443.366189: 250000 cpu-clock:ppp: 40058c workload1+0x3c (/data/perfload)
perfload 1822 1443.366439: 250000 cpu-clock:ppp: 40059c workload1+0x4c (/data/perfload)
perfload 1822 1443.366689: 250000 cpu-clock:ppp: 400598 workload1+0x48 (/data/perfload)
I copied the perf.unfold
to my development host, and ran perl scripts from Greg's website.
stackcollapse-perf.pl ~/shared/perf.unfold &> ~/shared/perf.fold
flamegraph.pl ~/shared/perf.fold > ~/shared/perf.svg
Stack count is low (0). Did something go wrong?
ERROR: No stack counts found
I checked the perf.fold
, its size is 0!!!
The perf
is cross-compiled with following features enabled.
Auto-detecting system features:
... dwarf: [ OFF ]
... dwarf_getlocations: [ OFF ]
... glibc: [ on ]
... libbfd: [ OFF ]
... libbfd-buildid: [ OFF ]
... libcap: [ OFF ]
... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ OFF ]
... zlib: [ on ]
... lzma: [ OFF ]
... get_cpuid: [ OFF ]
... bpf: [ OFF ]
... libaio: [ on ]
... libzstd: [ OFF ]
The SOC is a MIPS, and I am not sure why flamegraph.pl
failed, it seemed the stack info is empty in perf.data
? Or is there any feature I missed to make the stack unwinding work ? Or perf does NOT support MIPS stack analysis?
Thanks,
wangt13
(631 rep)
Oct 25, 2024, 12:03 PM
• Last activity: Oct 26, 2024, 02:06 AM
0
votes
0
answers
2387
views
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
I have cross-compiled avahi-0.8 library for the MIPS platform. I am able to run the avahi daemon from the console, but I'm getting the following warning: ```none WARNING: No NSS support for mDNS detected, consider installing nss-mdns! ``` How can I remove the above warning? Screenshot of the logs: [...
I have cross-compiled avahi-0.8 library for the MIPS platform. I am able to run the avahi daemon from the console, but I'm getting the following warning:
[root@Ingenic:~]# avahi-daemon --file=/system/etc/avahi/avahi-daemon.conf
Found user 'root' (UID 0) and group 'root' (GID 0).
Successfully dropped root privileges.
avahi-daemon 0.8 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Loading service file /system/etc/avahi/services/sftp-ssh.service.
Loading service file /system/etc/avahi/services/ssh.service.
socket() failed: Address family not supported by protocol
Failed to create IPv6 socket, proceeding in IPv4 only mode
socket() failed: Address family not supported by protocol
Joining mDNS multicast group on interface eth0.IPv4 with address 10.42.0.148.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.0.
New relevant interface lo.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for 10.42.0.148 on eth0.IPv4.
Registering new address record for 127.0.0.0 on lo.IPv4.
Server startup complete. Host name is Ingenic.local. Local service cookie is 315733776.
Service "Ingenic" (/system/etc/avahi/services/ssh.service) successfully established.
Service "Ingenic" (/system/etc/avahi/services/sftp-ssh.service) successfully established.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
How can I remove the above warning?
Screenshot of the logs:

Nirav Patel
(1 rep)
Aug 21, 2020, 07:26 AM
• Last activity: Feb 13, 2024, 09:49 PM
4
votes
1
answers
2755
views
How to forward internet connection in QEMU?
Following the description on how to start an [OpenWrt VM with QEMU][1], I downloaded the [MIPS kernel][2] and started it with this command: qemu-system-mips -kernel openwrt-22.03.3-malta-be-vmlinux-initramfs.elf -nographic -m 256 However there is no internet connection in the VM: root@(none):/# ping...
Following the description on how to start an OpenWrt VM with QEMU , I downloaded the MIPS kernel and started it with this command:
qemu-system-mips -kernel openwrt-22.03.3-malta-be-vmlinux-initramfs.elf -nographic -m 256
However there is no internet connection in the VM:
root@(none):/# ping google.com
ping: bad address 'google.com'
How could the host internet connection be used in QEMU?
**EDIT**
As suggested in the comments,
ping
will not work because it uses ICMP. However, when using wget
the following error occurs:
root@OpenWrt:~# wget http://google.com/
Downloading 'http://google.com/ '
Failed to send request: Operation not permitted
The network configuration looks like this:
root@OpenWrt:~# ifconfig
br-lan Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
inet6 addr: fd02:a553:49cb::1/60 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1248 (1.2 KiB) TX bytes:2822 (2.7 KiB)
eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1290 (1.2 KiB) TX bytes:2822 (2.7 KiB)
Interrupt:10 Base address:0x1060
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:528 errors:0 dropped:0 overruns:0 frame:0
TX packets:528 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:40288 (39.3 KiB) TX bytes:40288 (39.3 KiB)
Andy
(95 rep)
Apr 30, 2023, 05:07 PM
• Last activity: May 8, 2023, 03:59 PM
1
votes
1
answers
439
views
How can I flash an embedded device with new linux software?
I have this IP camera that I bought that's really pretty shady (it streams all the videos to some S3 bucket and forces me to use their software), but I'm pretty sure it runs embedded linux and I'm hoping I can just reinstall a fresh build. I'm a heavy linux user but I'm totally new to this level of...
I have this IP camera that I bought that's really pretty shady (it streams all the videos to some S3 bucket and forces me to use their software), but I'm pretty sure it runs embedded linux and I'm hoping I can just reinstall a fresh build. I'm a heavy linux user but I'm totally new to this level of modding.
To start, the camera has a
Ingenic T31
chip, which appears to be a MIPS processor. You can see from this photo there is some other chip below it, but it doesn't have any labels or anything. It's right next to the wireless antenna so make that's the radio controller?
Second, in the attached board, there are 4 holes that look like they might be fit for a USB adaptor. I have seen people solder ports into those, but I'm not sure if there is a way to connect without solder. (I'm terrible with solder).
Finally, there is also a micro SD card slot on the reverse side of that second board.
Aside from figuring out HOW to flash it, I also need to find the correct build of linux to install and run the camera. I'm planning to use this with HomeAssistant.
I know there is probably a lot of info out there I can find on my own, but maybe I'm not searching for the right buzzwords. I'd be happy just to be pointed in the right direction.
DAB
(475 rep)
Jan 6, 2023, 12:38 AM
• Last activity: Jan 17, 2023, 08:28 AM
1
votes
1
answers
420
views
Compiling a C program with Clang for MIPS (32-bit) on a FreeBSD x86_64/AMD64 system
Is there a way to compile a C program with Clang compiler for MIPS (32-bit) on a FreeBSD x86_64/AMD64 system?
Is there a way to compile a C program with Clang compiler for MIPS (32-bit) on a FreeBSD x86_64/AMD64 system?
ordinary_guy
(29 rep)
Sep 25, 2022, 03:53 PM
• Last activity: Sep 25, 2022, 09:33 PM
1
votes
1
answers
151
views
Why this script stuck at "can't execute" branch?
I'm using this tool-chian provided by a manufacture of control boards. I followed the instruction step by step but when I tried to compile example code, the compilation process got stuck at "$basename can't execute" branch of the if clause. I'm not exactly a wizard of bash scripts so I have no idea...
I'm using this tool-chian provided by a manufacture of control boards.
I followed the instruction step by step but when I tried to compile example code, the compilation process got stuck at "$basename can't execute" branch of the if clause.
I'm not exactly a wizard of bash scripts so I have no idea what I'm looking at.
#!/bin/bash
# uclibc-toolchain-wrapper
basename=$0
if [ -d $basename ]
then
echo "This can't be a directory."
exit 1;
fi
tool_name=${basename##*/}
if [[ $tool_name =~ "mips-linux-uclibc-gnu" ]]
then
prefix=${basename%-uclibc-*}
postfix=${basename##*mips-linux-uclibc}
$prefix$postfix "-muclibc" $@
else
echo "$basename can't execute."
exit 1;
fi
So what should I do to get this script rolling?
The user manual told me to modify environment variables in order to "install" the tool chain. Which consists basically of adding a designated path to "PATH" variable in .bashrc. Of course I've placed the entire toolchain inside the designated folder.
When I type "make" command in the source folder, the toolchain does appear to be called upon, but the execution stops at this script with an error printout:"uclibc-toolchain-wrapper can't execute". Where "uclibc-toolchain-wrapper" is the filename of this script.
I've tried this on lubuntu 13, ubuntu 22, Debian 5 and all met the same result.
Please help! Thanks in advance!
cream_pi
(123 rep)
Aug 29, 2022, 06:34 AM
• Last activity: Aug 30, 2022, 10:40 AM
3
votes
1
answers
1217
views
Meaning of MIPS flags in elf header
I was looking at the header of some elf files and noticed something odd: ELF Header: Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, big endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: MIPS R3000 Versi...
I was looking at the header of some elf files and noticed something odd:
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
...
Flags: 0x80000027, noreorder, pic, cpic, abi2, mips64r2
...
Why is it labeled as ELF32 but have a mips64r2 flag? What does that indicate? Does it mean that the file was compiled as a 32 bit program intended to be run on a 64 bit processor?
Also, if it is running on mips64r2, why is the machine labeled as MIPS r3000?
If I wanted to run this with qemu, what type of environment would I need? mips64 r2? mips r3000?
charlesw
(130 rep)
Oct 17, 2016, 05:33 PM
• Last activity: Feb 7, 2022, 01:15 PM
9
votes
1
answers
24894
views
How to install Linux on the Playstation 2
Looking to learn about game development? Are you a Linux enthusiast looking to test the claim that "Linux runs on everything"? Perhaps you are a software developer who is looking to release for multiple architectures, and you don't have another MIPS Little Endian machine on-hand for testing your pro...
Looking to learn about game development? Are you a Linux enthusiast looking to test the claim that "Linux runs on everything"? Perhaps you are a software developer who is looking to release for multiple architectures, and you don't have another MIPS Little Endian machine on-hand for testing your programme. Whatever your situation there are a surprising number of reasons to install Linux on a Playstation 2, even sixteen years after it's release (boy do I feel old all of a sudden.), yet an equally surprising lack of documentation about it or how to install it.
Now don't get me wrong, if you want to use the original Sony Linux Kit, or one of it's updated open source releases on a fat PS2 with a network adapter and an IDE hard disk you can find plenty of info. However this requires the acquisition of several things, and can be quite expensive, especially when it comes to the Sony Linux Kit itself. This guide will cover some basics about the PS2's native hardware, and it's hardware compatibility, and then we'll move on to how to install Linux on a wider variety of PS2.
What CPU does the PS2 use?
The PS2 uses a single core "Emotion Engine" CPU, clocked at 295MHz in the original fat models, and 299MHz in newer slim models. The Emotion Engine is a 64-bit MIPS Little Endian CPU, with support for 128-bit addresses.
How much RAM does the PS2 have?
It has 32MB RDRAM and 4MB of eDRAM.
What kind of GPU does it have?
The PS2 uses the "Graphics Synthesizer" GPU clocked at 147.4MHz, and is capable of outputting up to 1920x1080 graphics at 60Hz in 32-bit color.
What external storage does it support?
An unmodified PS2 supports Audio-CD, Video-DVD, and up to two memory cards of up to 128MB in size for game saves. A PS2 modified with a software exploit also supports two memory cards of up to 128MB for general file management and storage, and browsing files on data-CD/DVDs via a 3rd party file manager such as uLaunchELF, as well as some USB 1.1 disks, with support for USB 2.0 disks being available on newer slim models via software support. A PS2 modified with a modchip has added support for data-CDs and DVDs without a 3rd party programme.
Now on to the Linux installation: (a quick side note, if you just want to test or play around with Linux on your PS2, you can simply burn the image found here: [link] (https://sourceforge.net/projects/kernelloader/files/BlackRhino%20Linux%20Distribution/Live%20Linux%20DVD/PS2%20Live%20Linux%20DVD%20v3/ps2linux_live_v3_ntsc_large_no_modchip.7z/download) to a DVD and run this programme [link] (https://sourceforge.net/projects/kernelloader/files/Kernelloader/Kernelloader%203.0/kloader3.0.elf/download) via uLaunchELF from a flash drive or memory card with no setup required. Now on with the Linux!)
Alison E.E.
(464 rep)
Feb 11, 2017, 01:28 PM
• Last activity: Jun 1, 2021, 03:00 PM
3
votes
1
answers
885
views
qemu mips and debian networking not working
since few days I still can not run network on debian8.7 (or ubuntu 16.04) and qemu. all installed with default packages (or - in case of qemu, from src too relating to shadow'sblog post). I think that the bug is inside the /etc/network/interfaces or in the running script. I will paste both below. Ma...
since few days I still can not run network on debian8.7 (or ubuntu 16.04) and qemu. all installed with default packages (or - in case of qemu, from src too relating to shadow'sblog post).
I think that the bug is inside the /etc/network/interfaces or in the running script.
I will paste both below. Maybe you will spot the bug and help me a little bit. Thank you for your time.
/etc/network/interfaces
:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
# auto br0
iface br0 inet dhcp
pre-up tunctl -t tap0 -g tuntap
pre-up tunctl -t tap1 -g tuntap
pre-up ip link set tap0 up
pre-up ip link set tap1 up
bridge_ports eth0 tap0 tap1
bridge_stp off
bridge_maxwait 0
bridge_fd 0
post-down ip link set tap0 down
post-down ip link set tap1 down
post-down tunctl -d tap0
post-down tunctl -d tap1
it is from debian 8.7 (I downloaded and installed latest version
some about one hour ago).
Script run:
#!/bin/sh
image="/home/myuser/routers_research/debian-mipsel/debian_squeeze_mipsel_standard.qcow2"
kernel="/home/myuser/routers_research/debian-mipsel/vmlinux-2.6.32-5-4kc-malta"
echo "[+] Start debian mipsel.."
qemu-system-mipsel -net nic -net tap,ifname=tap1,script=no,downscript=no -nographic -M malta -m 256 -kernel $kernel -hda $image -append "root=/dev/sda1 console=tty0"
qemuser
Mar 26, 2017, 05:50 PM
• Last activity: May 18, 2021, 08:32 PM
1
votes
0
answers
2195
views
How to compile and install iperf on a MIPS based router?
I have a DIR-825 router based on Atheros AR7161 (MIPS) running DD-WRT v24-sp2 std. How can I compile and install iperf on it? Can I compile it directly on the target device, or do I have to cross compile it and then transfer the binary to the target device? Is this possible, and where do I begin? Wh...
I have a DIR-825 router based on Atheros AR7161 (MIPS) running DD-WRT v24-sp2 std. How can I compile and install iperf on it? Can I compile it directly on the target device, or do I have to cross compile it and then transfer the binary to the target device? Is this possible, and where do I begin? What kind of tools do I need? What's involved in doing something like this?
*Side note: I have limited knowledge of Linux, so please provide as thorough answer as possible, and not just some external links. If you do post a link, make sure it links to some article or a blog post that thoroughly explains the process.*
Samir
(846 rep)
Nov 18, 2013, 09:55 PM
• Last activity: Apr 6, 2021, 11:08 AM
1
votes
0
answers
2239
views
How do I compare the BogoMIPS of ARM based computers and Intel base computers?
Looking at my ARM based Jetson computers, I see a BogoMIPS of **62.5**. On my Intel based computers, with Xeons, I see **4,200**. I've found this note on [Wikipedia](https://en.wikipedia.org/wiki/BogoMips) > ## Timer-based delays > > In 2012, ARM contributed a new udelay implementation allowing the...
Looking at my ARM based Jetson computers, I see a BogoMIPS of **62.5**.
On my Intel based computers, with Xeons, I see **4,200**.
I've found this note on [Wikipedia](https://en.wikipedia.org/wiki/BogoMips)
> ## Timer-based delays
>
> In 2012, ARM contributed a new udelay implementation allowing the system timer built into many ARMv7 CPUs to be used instead of a busy-wait loop. This implementation was released in Version 3.6 of the Linux kernel. Timer-based delays are more robust on systems that use frequency scaling to dynamically adjust the processor's speed at runtime, as loops_per_jiffies values may not necessarily scale linearly. Also, since the timer frequency is known in advance, no calibration is needed at boot time.
>
> One side effect of this change is that the BogoMIPS value will reflect the timer frequency, not the CPU's core frequency. Typically the timer frequency is much lower than the processor's maximum frequency, and some users may be surprised to see an unusually low BogoMIPS value when comparing against systems that use traditional busy-wait loops.
However, that doesn't really tell me how to convert between both CPUs.
My ARM is 1.2Ghz and my Intel is 2.1Ghz (boosts to 4.1Ghz or so).
So I'm sure that the numbers would be closer if both platforms used the same algorithm, I'm just not too sure how to interpret that info... So the question is: How do I convert one BogoMIPS to the other?
Alexis Wilke
(3095 rep)
Mar 2, 2021, 08:13 PM
0
votes
0
answers
25
views
I want to copy complete drive having IRIX 5.3 installed
I am new to Linux and want to replicate a hard drive, having IRIX 5.3 installed. Please guide the easy and best way.
I am new to Linux and want to replicate a hard drive, having IRIX 5.3 installed. Please guide the easy and best way.
asif shahzad
(1 rep)
Feb 19, 2021, 07:16 PM
1
votes
0
answers
490
views
The size of my lzma compressed file is different from one system to another using same compression ratio - why?
I have an lzma compressed file that I've extracted from a firmware image (via binwalk) that is X bytes uncompressed and Y bytes compressed. When I try to compress the extracted file again - without any modification and using the same compression ratio - on my machine (Ubuntu 18.04), I end up with a...
I have an lzma compressed file that I've extracted from a firmware image (via binwalk) that is X bytes uncompressed and Y bytes compressed.
When I try to compress the extracted file again - without any modification and using the same compression ratio - on my machine (Ubuntu 18.04), I end up with a compressed image that is Z bytes instead of Y bytes.
My guess is that is has to do with the version of
lzma
that I'm using vs the version that was originally used - is that correct? And if so, is there a way to tell which version of lzma
was used originally?
Also, the compressed file extracted from binwalk
has the .7z
extension, but running file orig_compressed.7z
says that it's an lzma file. I'm not sure if that's making a difference.
Edit: the firmware uses the MIPS architecture - I've tried using qemu-system-mipsel
to run the MIPS lzma and I still got a compressed file that was a different size than what I'm expecting it to be.
compression_help1234
(11 rep)
Sep 10, 2020, 03:34 PM
4
votes
3
answers
29810
views
bnx2: Can't load firmware file "bnx2/bnx2-mips-09-6.2.1b.fw"
I just compiled the kernel 3.10.19 from kernel.org. Support for bnx2 is enabled. On my server when I try to start the eth0 interface I got the following error : bnx2: Can't load firmware file "bnx2/bnx2-mips-09-6.2.1b.fw" In `/lib/firmware/bnx2` I have the following files : bnx2-mips-06-6.2.1.fw bnx...
I just compiled the kernel 3.10.19 from kernel.org.
Support for bnx2 is enabled. On my server when I try to start the eth0 interface I got the following error :
bnx2: Can't load firmware file "bnx2/bnx2-mips-09-6.2.1b.fw"
In
/lib/firmware/bnx2
I have the following files :
bnx2-mips-06-6.2.1.fw
bnx2-rv2p-09-6.0.17.fw
bnx2-mips-09-6.2.1a.fw
bnx2-rv2p-06-6.0.15.fw
bnx2-rv2p-09ax-6.0.17.fw
The file bnx2-mips-09-6.2.1b.fw is missing.
If I do :
cp bnx2-mips-09-6.2.1a.fw bnx2-mips-09-6.2.1b.fw
it is working but this is not a clean solution.
I have been reading the following post : https://lkml.org/lkml/2012/4/18/142 But I am not sure to understand.
What is the best way to solve the problem?
Hugo
(2498 rep)
Nov 21, 2013, 03:52 PM
• Last activity: Jul 20, 2020, 05:22 PM
1
votes
1
answers
502
views
how can I run old programs from a MIPS?
I have an old PC with a program called atomTV, for viewing, and producing movies from molecular trajectory files. I only have a binary, and the platform it ran on was 64-bit MIPS architecture, where I was running IRIX. I have spoke with the creator, and he says he lost the source. My IRIX PC has die...
I have an old PC with a program called atomTV, for viewing, and producing movies from molecular trajectory files. I only have a binary, and the platform it ran on was 64-bit MIPS architecture, where I was running IRIX. I have spoke with the creator, and he says he lost the source. My IRIX PC has died recently, but I still want to use this program. What can be done?
The files are xyz, dcd, pdb and that type of thing. Preferably, I would like to know some way to run the program in a modern Unix/Linux environment. I have access to all the old files from the OS if that matters.
When I tried to run the program in Linux, I got wrong ELF type errors.
j0h
(3949 rep)
Jul 31, 2015, 02:59 PM
• Last activity: Jun 26, 2019, 07:30 PM
2
votes
1
answers
2997
views
Building mips package on amd64: Exec format error chroot: failed to run command 'mount'
I'm trying to cross-build a Debian/Ubuntu package on a running amd64 system to mips arch. I've tried several methods, from pubilder to sbuild, but I keep failing. About the latter, on a freshly installed Debian 9 I do: ```bash apt-get -y install sbuild sbuild-createchroot --arch=mips --make-sbuild-t...
I'm trying to cross-build a Debian/Ubuntu package on a running amd64 system to mips arch. I've tried several methods, from pubilder to sbuild, but I keep failing. About the latter, on a freshly installed Debian 9 I do:
apt-get -y install sbuild
sbuild-createchroot --arch=mips --make-sbuild-tarball=/srv/chroots/wheezy-sbuild.tgz wheezy /srv/chroots/wheezy http://archive.debian.org/debian/
But in the end I get:
W: Failure trying to run: chroot /srv/chroots/wheezy dpkg-deb -f /var/cache/apt/archives/dpkg_1.16.18_mips.deb Version
W: See /srv/chroots/wheezy/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /srv/chroots/wheezy mount -t proc proc /proc
W: See /srv/chroots/wheezy/debootstrap/debootstrap.log for details
E: Error running debootstrap at /usr/sbin/sbuild-createchroot line 268.
and the log contains:
chroot: failed to run command 'dpkg-deb': Exec format error
chroot: failed to run command 'mount': Exec format error
All the methods I tried end up with that *Exec format error* while trying different commands.
Maxxer
(143 rep)
May 15, 2019, 07:58 PM
• Last activity: May 17, 2019, 11:51 AM
1
votes
0
answers
608
views
How to start X server in Debian Wheezy mips running on qemu?
I created a debian mips virtual machine by downloading qcow2 images from [here][1]. I then started the virtual machine by qemu-system-mips \ -m 256 \ -M malta \ -kernel vmlinux-3.2.0-4-4kc-malta \ -hda debian_wheezy_mips_standard.qcow2 \ -append "root=/dev/sda1 console=tty0" \ -net user,hostfwd=tcp:...
I created a debian mips virtual machine by downloading qcow2 images from here . I then started the virtual machine by
qemu-system-mips \
-m 256 \
-M malta \
-kernel vmlinux-3.2.0-4-4kc-malta \
-hda debian_wheezy_mips_standard.qcow2 \
-append "root=/dev/sda1 console=tty0" \
-net user,hostfwd=tcp::10022-:22 \
-net nic
I can ssh into the machine and can create a vnc server by appending
-vnc :1
. But I cannot start X by typing startx or any means. I have installed all necessary packages using apt-get install xfonts-base xfonts-cyrillic xserver-xorg-video-vesa lightdm
I created a new configuration by using X -configure
But it says
vesa: Ignoring device with a bound kernel driver
Backtrace:
0: X (xorg_backtrace+0x70) [0x5a3980]
Segmentation fault at address (nil)
Fatal server error:
Caught signal 11 (Segmentation fault). Server aborting
Running startx
gives
server error: no screens found
This is the full /var/log/Xorg.0.log from the guest debian machine:
X.Org X Server 1.12.4
Release Date: 2012-08-27
[ 437.907] X Protocol Version 11, Revision 0
[ 437.909] Build Operating System: Linux 3.2.0-4-octeon mips Debian
[ 437.910] Current Operating System: Linux debian-mips 3.2.0-4-4kc-malta #1 Debian 3.2.51-1 mips
[ 437.911] Kernel command line: root=/dev/sda1 console=tty0
[ 437.916] Build Date: 09 February 2015 10:24:38AM
[ 437.916] xorg-server 2:1.12.4-6+deb7u6 (Julien Cristau )
[ 437.916] Current version of pixman: 0.26.0
[ 437.917] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 437.917] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 437.925] (==) Log file: "/var/log/Xorg.0.log", Time: Sat May 11 10:25:13 2019
[ 437.952] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 437.971] (==) No Layout section. Using the first Screen section.
[ 437.972] (==) No screen section available. Using defaults.
[ 437.972] (**) |-->Screen "Default Screen Section" (0)
[ 437.973] (**) | |-->Monitor ""
[ 437.983] (==) No monitor specified for screen "Default Screen Section".
Using a default monitor configuration.
[ 437.985] (==) Automatically adding devices
[ 437.985] (==) Automatically enabling devices
[ 437.986] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.
[ 437.987] Entry deleted from font path.
[ 437.987] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/cyrillic,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins
[ 437.987] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 437.987] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 437.987] (II) Loader magic: 0x5ee010
[ 437.987] (II) Module ABI versions:
[ 437.987] X.Org ANSI C Emulation: 0.4
[ 437.987] X.Org Video Driver: 12.1
[ 437.988] X.Org XInput driver : 16.0
[ 437.988] X.Org Server Extension : 6.0
[ 437.995] (--) PCI:*(0:0:18:0) 1013:00b8:1af4:1100 rev 0, Mem @ 0x10000000/33554432, 0x12050000/4096, BIOS @ 0x????????/65536
[ 437.996] (II) LoadModule: "extmod"
[ 438.006] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
[ 438.011] (II) Module extmod: vendor="X.Org Foundation"
[ 438.011] compiled for 1.12.4, module version = 1.0.0
[ 438.012] Module class: X.Org Server Extension
[ 438.012] ABI class: X.Org Server Extension, version 6.0
[ 438.013] (II) Loading extension SELinux
[ 438.013] (II) Loading extension MIT-SCREEN-SAVER
[ 438.013] (II) Loading extension XFree86-VidModeExtension
[ 438.013] (II) Loading extension XFree86-DGA
[ 438.013] (II) Loading extension DPMS
[ 438.014] (II) Loading extension XVideo
[ 438.014] (II) Loading extension XVideo-MotionCompensation
[ 438.014] (II) Loading extension X-Resource
[ 438.014] (II) LoadModule: "dbe"
[ 438.017] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
[ 438.019] (II) Module dbe: vendor="X.Org Foundation"
[ 438.019] compiled for 1.12.4, module version = 1.0.0
[ 438.019] Module class: X.Org Server Extension
[ 438.019] ABI class: X.Org Server Extension, version 6.0
[ 438.019] (II) Loading extension DOUBLE-BUFFER
[ 438.019] (II) LoadModule: "glx"
[ 438.020] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 438.022] (II) Module glx: vendor="X.Org Foundation"
[ 438.022] compiled for 1.12.4, module version = 1.0.0
[ 438.022] ABI class: X.Org Server Extension, version 6.0
[ 438.022] (==) AIGLX enabled
[ 438.023] (II) Loading extension GLX
[ 438.023] (II) LoadModule: "record"
[ 438.024] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[ 438.025] (II) Module record: vendor="X.Org Foundation"
[ 438.025] compiled for 1.12.4, module version = 1.13.0
[ 438.025] Module class: X.Org Server Extension
[ 438.025] ABI class: X.Org Server Extension, version 6.0
[ 438.025] (II) Loading extension RECORD
[ 438.025] (II) LoadModule: "dri"
[ 438.027] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
[ 438.028] (II) Module dri: vendor="X.Org Foundation"
[ 438.028] compiled for 1.12.4, module version = 1.0.0
[ 438.028] ABI class: X.Org Server Extension, version 6.0
[ 438.029] (II) Loading extension XFree86-DRI
[ 438.029] (II) LoadModule: "dri2"
[ 438.030] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
[ 438.031] (II) Module dri2: vendor="X.Org Foundation"
[ 438.032] compiled for 1.12.4, module version = 1.2.0
[ 438.032] ABI class: X.Org Server Extension, version 6.0
[ 438.032] (II) Loading extension DRI2
[ 438.032] (==) Matched cirrus as autoconfigured driver 0
[ 438.032] (==) Matched fbdev as autoconfigured driver 1
[ 438.033] (==) Assigned the driver to the xf86ConfigLayout
[ 438.033] (II) LoadModule: "cirrus"
[ 438.034] (II) Loading /usr/lib/xorg/modules/drivers/cirrus_drv.so
[ 438.035] (II) Module cirrus: vendor="X.Org Foundation"
[ 438.035] compiled for 1.12.1.902, module version = 1.4.0
[ 438.035] Module class: X.Org Video Driver
[ 438.035] ABI class: X.Org Video Driver, version 12.0
[ 438.035] (II) LoadModule: "fbdev"
[ 438.036] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[ 438.037] (II) Module fbdev: vendor="X.Org Foundation"
[ 438.037] compiled for 1.12.1, module version = 0.4.2
[ 438.037] ABI class: X.Org Video Driver, version 12.0
[ 438.037] (II) CIRRUS: driver for Cirrus chipsets: CLGD5430, CLGD5434-4, CLGD5434-8,
CLGD5436, CLGD5446, CLGD5480, CL-GD5462, CL-GD5464, CL-GD5464BD,
CL-GD5465, CL-GD7548, CL-GD7555, CL-GD7556
[ 438.038] (II) FBDEV: driver for framebuffer: fbdev
[ 438.040] (--) using VT number 7
[ 438.060] (WW) Falling back to old probe method for cirrus
[ 438.061] (--) Assigning device section with no busID to primary device
[ 438.061] (--) Chipset CLGD5446 found
[ 438.062] (EE) cirrus: The PCI device 0xb8 at 00@00:18:0 has a kernel module claiming it.
[ 438.062] (EE) cirrus: This driver cannot operate until it has been unloaded.
[ 438.062] (WW) Falling back to old probe method for fbdev
[ 438.062] (II) Loading sub module "fbdevhw"
[ 438.062] (II) LoadModule: "fbdevhw"
[ 438.063] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[ 438.065] (II) Module fbdevhw: vendor="X.Org Foundation"
[ 438.065] compiled for 1.12.4, module version = 0.0.2
[ 438.065] ABI class: X.Org Video Driver, version 12.1
[ 438.066] (EE) No devices detected.
[ 438.066]
Fatal server error:
[ 438.066] no screens found
[ 438.066]
I am using a nixos 19.03 machine as the host and compiled qemu from git.
desertSniper87
(123 rep)
May 11, 2019, 10:32 AM
2
votes
1
answers
3823
views
“Illegal instruction” on a static MIPS binary
On my MIPS box I'm trying to run a program. I use a cross compiler for mips. When I run my program, I'm getting Illegal instruction I pulled of one binary from it, called `cputest`. It basically prints “hello world” with some delay. Here is what `readelf` tells about it: readelf -a ./cputest.mips EL...
On my MIPS box I'm trying to run a program. I use a cross compiler for mips. When I run my program, I'm getting
Illegal instruction
I pulled of one binary from it, called
cputest
. It basically prints “hello world” with some delay. Here is what readelf
tells about it:
readelf -a ./cputest.mips
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x4004e0
Start of program headers: 52 (bytes into file)
Start of section headers: 1956 (bytes into file)
Flags: 0x1007, noreorder, pic, cpic, o32, mips1
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 20
Section header string table index: 19
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 00400134 000134 000014 00 A 0 0 1
[ 2] .reginfo MIPS_REGINFO 00400148 000148 000018 18 A 0 0 4
[ 3] .dynamic DYNAMIC 00400160 000160 0000c8 08 A 6 0 4
[ 4] .hash HASH 00400228 000228 000058 04 A 5 0 4
[ 5] .dynsym DYNSYM 00400280 000280 000110 10 A 6 1 4
[ 6] .dynstr STRTAB 00400390 000390 0000d0 00 A 0 0 1
[ 7] .init PROGBITS 00400460 000460 000028 00 AX 0 0 4
[ 8] .text PROGBITS 00400490 000490 0000b0 00 AX 0 0 16
[ 9] .MIPS.stubs PROGBITS 00400540 000540 000040 00 AX 0 0 4
.fini PROGBITS 00400580 000580 000028 00 AX 0 0 4
.rodata PROGBITS 004005a8 0005a8 000010 01 AMS 0 0 4
.data PROGBITS 004105c0 0005c0 000010 00 WA 0 0 16
.rld_map PROGBITS 004105d0 0005d0 000004 00 WA 0 0 4
.got PROGBITS 004105e0 0005e0 000020 04 WAp 0 0 16
.pdr PROGBITS 00000000 000600 0000c0 00 0 0 4
.comment PROGBITS 00000000 0006c0 000033 01 MS 0 0 1
.gnu.attributes LOOS+ffffff5 00000000 0006f3 000010 00 0 0 1
.mdebug.abi32 PROGBITS 00000010 000703 000000 00 0 0 1
.shstrtab STRTAB 00000000 000703 0000a1 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x00400034 0x00400034 0x00100 0x00100 R E 0x4
INTERP 0x000134 0x00400134 0x00400134 0x00014 0x00014 R 0x1
[Requesting program interpreter: /lib/ld-uClibc.so.0]
REGINFO 0x000148 0x00400148 0x00400148 0x00018 0x00018 R 0x4
LOAD 0x000000 0x00400000 0x00400000 0x005b8 0x005b8 R E 0x10000
LOAD 0x0005c0 0x004105c0 0x004105c0 0x00040 0x00040 RW 0x10000
DYNAMIC 0x000160 0x00400160 0x00400160 0x000c8 0x000c8 RWE 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
NULL 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .reginfo
03 .interp .reginfo .dynamic .hash .dynsym .dynstr .init .text .MIPS.stubs .fini .rodata
04 .data .rld_map .got
05 .dynamic
06
07
Dynamic section at offset 0x160 contains 20 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libc.so.0]
0x0000000f (RPATH) Library rpath: [/home/xia/Builds/H208N_V1.0_Dev/csp/release/tools/uclibc/lib]
0x0000000c (INIT) 0x400460
0x0000000d (FINI) 0x400580
0x00000004 (HASH) 0x400228
0x00000005 (STRTAB) 0x400390
0x00000006 (SYMTAB) 0x400280
0x0000000a (STRSZ) 208 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x70000016 (MIPS_RLD_MAP) 0x4105d0
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x4105e0
0x70000001 (MIPS_RLD_VERSION) 1
0x70000005 (MIPS_FLAGS) NOTPOT
0x70000006 (MIPS_BASE_ADDRESS) 0x400000
0x7000000a (MIPS_LOCAL_GOTNO) 2
0x70000011 (MIPS_SYMTABNO) 17
0x70000012 (MIPS_UNREFEXTNO) 19
0x70000013 (MIPS_GOTSYM) 0xb
0x00000000 (NULL) 0x0
There are no relocations in this file.
The decoding of unwind sections for machine type MIPS R3000 is not currently supported.
Symbol table '.dynsym' contains 17 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 004105c0 0 NOTYPE GLOBAL DEFAULT 12 _fdata
2: 00000001 0 SECTION GLOBAL DEFAULT ABS _DYNAMIC_LINKING
3: 004185d0 0 NOTYPE GLOBAL DEFAULT ABS _gp
4: 00400490 0 NOTYPE GLOBAL DEFAULT 8 _ftext
5: 004105d0 0 OBJECT GLOBAL DEFAULT 13 __RLD_MAP
6: 00410600 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
7: 00410600 0 NOTYPE GLOBAL DEFAULT ABS _edata
8: 004105e0 0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
9: 00410600 0 NOTYPE GLOBAL DEFAULT ABS _end
10: 00410600 0 NOTYPE GLOBAL DEFAULT ABS _fbss
11: 00400580 28 FUNC GLOBAL DEFAULT 10 _fini
12: 00400490 72 FUNC GLOBAL DEFAULT 8 main
13: 00400560 0 FUNC GLOBAL DEFAULT UND __uClibc_main
14: 00400460 28 FUNC GLOBAL DEFAULT 7 _init
15: 00400550 0 FUNC GLOBAL DEFAULT UND sleep
16: 00400540 0 FUNC GLOBAL DEFAULT UND printf
Histogram for bucket list length (total of 3 buckets):
Length Number % of total Coverage
0 0 ( 0.0%)
1 0 ( 0.0%) 0.0%
2 0 ( 0.0%) 0.0%
3 0 ( 0.0%) 0.0%
4 0 ( 0.0%) 0.0%
5 2 ( 66.7%) 62.5%
6 1 ( 33.3%) 100.0%
No version information found in this file.
Attribute Section: gnu
File Attributes
Tag_GNU_MIPS_ABI_FP: Soft float
Primary GOT:
Canonical gp value: 004185d0
Reserved entries:
Address Access Initial Purpose
004105e0 -32752(gp) 00000000 Lazy resolver
004105e4 -32748(gp) 80000000 Module pointer (GNU extension)
Global entries:
Address Access Initial Sym.Val. Type Ndx Name
004105e8 -32744(gp) 00400580 00400580 FUNC 10 _fini
004105ec -32740(gp) 00400490 00400490 FUNC 8 main
004105f0 -32736(gp) 00400560 00400560 FUNC UND __uClibc_main
004105f4 -32732(gp) 00400460 00400460 FUNC 7 _init
004105f8 -32728(gp) 00400550 00400550 FUNC UND sleep
004105fc -32724(gp) 00400540 00400540 FUNC UND printf
When I cross compile my program (which just prints “hello world”) without the -static
flag and try to run it, here is what happens:
# ls
hello.mips
# ./hello.mips
/bin/sh: ./hello.mips: Permission denied
# chmod +x hello.mips
# ./hello.mips
/bin/sh: ./hello.mips: not found
# ls -la
drwxrwxrwx 2 zhangxia root 0 Aug 8 00:01 .
drwxr-xr-x 3 zhangxia root 0 Aug 7 22:46 ..
-rwsrwsrwx 1 888 root 5743 Aug 8 00:01 hello.mips
Why can't I find it when it's there?
So I compile it with the -static
flag and here is the readelf
output (because of size limits here I will put just a part)
readelf -a hello.static
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x400280
Start of program headers: 52 (bytes into file)
Start of section headers: 647608 (bytes into file)
Flags: 0x1007, noreorder, pic, cpic, o32, mips1
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 33
Section header string table index: 30
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .note.ABI-tag NOTE 004000f4 0000f4 000020 00 A 0 0 4
[ 2] .reginfo MIPS_REGINFO 00400114 000114 000018 18 A 0 0 4
[ 3] .note.gnu.build-i NOTE 0040012c 00012c 000024 00 A 0 0 4
[ 4] .rel.dyn REL 00400150 000150 000098 08 A 0 0 4
[ 5] .init PROGBITS 004001e8 0001e8 000098 00 AX 0 0 4
[ 6] .text PROGBITS 00400280 000280 07b5a0 00 AX 0 0 16
[ 7] __libc_freeres_fn PROGBITS 0047b820 07b820 0013a8 00 AX 0 0 4
[ 8] .fini PROGBITS 0047cbc8 07cbc8 000054 00 AX 0 0 4
[ 9] .rodata PROGBITS 0047cc20 07cc20 015a00 00 A 0 0 16
.eh_frame PROGBITS 004a2620 092620 0019a4 00 WA 0 0 4
.gcc_except_table PROGBITS 004a3fc4 093fc4 00014e 00 WA 0 0 1
.tdata PROGBITS 004a4114 094114 000010 00 WAT 0 0 4
.tbss NOBITS 004a4124 094124 000018 00 WAT 0 0 4
.ctors PROGBITS 004a4124 094124 000008 00 WA 0 0 4
.dtors PROGBITS 004a412c 09412c 00000c 00 WA 0 0 4
.jcr PROGBITS 004a4138 094138 000004 00 WA 0 0 4
.data.rel.ro PROGBITS 004a413c 09413c 00259c 00 WA 0 0 4
.data PROGBITS 004a66e0 0966e0 0007c0 00 WA 0 0 16
__libc_subfreeres PROGBITS 004a6ea0 096ea0 000030 00 WA 0 0 4
__libc_atexit PROGBITS 004a6ed0 096ed0 000004 00 WA 0 0 4
.got PROGBITS 004a6ee0 096ee0 000a48 04 WAp 0 0 16
.sdata PROGBITS 004a7928 097928 000004 00 WAp 0 0 4
.sbss NOBITS 004a7930 09792c 0000fc 00 WAp 0 0 8
.bss NOBITS 004a7a30 09792c 001c10 00 WA 0 0 16
__libc_freeres_pt NOBITS 004a9640 09792c 000018 00 WA 0 0 4
.pdr PROGBITS 00000000 09792c 006700 00 0 0 4
.comment PROGBITS 00000000 09e02c 000039 01 MS 0 0 1
.gnu.attributes LOOS+ffffff5 00000000 09e065 000010 00 0 0 1
.mdebug.abi32 PROGBITS 00001320 09e075 000000 00 0 0 1
.shstrtab STRTAB 00000000 09e075 000140 00 0 0 1
.symtab SYMTAB 00000000 09e6e0 006d70 10 32 655 4
.strtab STRTAB 00000000 0a5450 0065f4 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
REGINFO 0x000114 0x00400114 0x00400114 0x00018 0x00018 R 0x4
LOAD 0x000000 0x00400000 0x00400000 0x92620 0x92620 R E 0x10000
LOAD 0x092620 0x004a2620 0x004a2620 0x0530c 0x07038 RW 0x10000
NOTE 0x0000f4 0x004000f4 0x004000f4 0x00020 0x00020 R 0x4
NOTE 0x00012c 0x0040012c 0x0040012c 0x00024 0x00024 R 0x4
TLS 0x094114 0x004a4114 0x004a4114 0x00010 0x00028 R 0x4
Section to Segment mapping:
Segment Sections...
00 .reginfo
01 .note.ABI-tag .reginfo .note.gnu.build-id .rel.dyn .init .text __libc_freeres_fn .fini .rodata
02 .eh_frame .gcc_except_table .tdata .ctors .dtors .jcr .data.rel.ro .data __libc_subfreeres __libc_atexit .got .sdata .sbss .bss __libc_freeres_ptrs
03 .note.ABI-tag
04 .note.gnu.build-id
05 .tdata .tbss
There is no dynamic section in this file.
Relocation section '.rel.dyn' at offset 0x150 contains 19 entries:
Offset Info Type Sym.Value Sym. Name
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
00000000 00000000 R_MIPS_NONE
The decoding of unwind sections for machine type MIPS R3000 is not currently supported.
Symbol table '.symtab' contains 1751 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 004000f4 0 SECTION LOCAL DEFAULT 1
2: 00400114 0 SECTION LOCAL DEFAULT 2
1747: 004a5d58 36 OBJECT GLOBAL DEFAULT 17 _nl_C_LC_IDENTIFICATION
1748: 004a9580 76 OBJECT GLOBAL DEFAULT 24 _dl_ns
1749: 00450f20 3016 FUNC GLOBAL DEFAULT 6 _nl_load_locale_from_arch
1750: 004380e0 248 FUNC WEAK DEFAULT 6 wctrans
No version information found in this file.
Displaying notes found at file offset 0x000000f4 with length 0x00000020:
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
OS: Linux, ABI: 2.6.18
Displaying notes found at file offset 0x0000012c with length 0x00000024:
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Build ID: a56a4b258e108ec9affb61c4a8ba46527052bca9
Attribute Section: gnu
File Attributes
Tag_GNU_MIPS_ABI_FP: Hard float (double precision)
Both binaries (static and dynamic) runs just fine in quemu and on my second MIPS box. Any thoughts?
Could “Illegal instruction” be due to different ld-uClibc
, libc names/versions?
@Stephen-Kitt Here it is
# ldd ./hello.mips
/bin/sh: ldd: not found
cat proc/version
Linux version 2.6.30.9 (xia@njzd) (gcc version 4.4.6 (Realtek RSDK-1.5.6p2) ) #2 Wed Apr 29 18:57:54 CST 2015
# cat proc/cpuinfo
system type: RTL8672
processor: 0
cpu model : 56322
BogoMIPS: 619.31
tlb_entries : 64
mips16 implemented : yes
Im running Ubuntu14.04 basicly
mips-gcc -o hello.mips hello.c
mips-gcc -static -o hello.static hello.c
mips gcc is from Debian rep
$ mips-linux-gnu-gcc -v
Using built-in specs.
Target: mips-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/mips-linux-gnu/include/c++/4.4.5 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --disable-libssp --enable-targets=all --enable-checking=release --program-prefix=mips-linux-gnu- --includedir=/usr/mips-linux-gnu/include --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=mips-linux-gnu --with-headers=/usr/mips-linux-gnu/include --with-libs=/usr/mips-linux-gnu/lib
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)
I obtained it from here http://www.emdebian.org/debian/
Slobodan Vidovic
(185 rep)
Aug 8, 2015, 02:05 AM
• Last activity: Mar 28, 2019, 03:52 PM
Showing page 1 of 20 total questions