Re: How do I run Debian for ARM in windows and compile code?
I am new to Linux and I need to fins=d a way to run Debian for ARM in windows and compile the code. What software would be best to write code in?
- nick.mccloud
- Posts: 1144
- Joined: Sat Feb 04, 2012 4:18 pm
Re: How do I run Debian for ARM in windows and compile code?
There are a number of ways of emulating Debian on ARM - search for Qemu on the forum.
Do you really need to compile - there are many packages already preprepared.
Do you really need to compile - there are many packages already preprepared.
Pico/RP2040 ≠ Arduino
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute
Re: How do I run Debian for ARM in windows and compile code?
Well i need to write software for a front end to an oscilloscope based around the Pi
Re: How do I run Debian for ARM in windows and compile code?
Maybe what you really need is a cross compiler. You can install x86 Linux in a virtual machine on your Windows PC and compile your code on there but targeting the ARM processor on the Pi. This will be much faster than running a compiler within an emulated environment.
-
- Posts: 239
- Joined: Thu Jan 12, 2012 5:45 pm
Re: How do I run Debian for ARM in windows and compile code?
As people have said it's possible to run the ARM Debian RPi build on Windows using QEMU. The process for doing this is described on this group but is fragmented over many posts and forums. A search for qemu and a LOT of research should get you somewhere.
Then AIUI you need to install a suitable development environment. Python is there but you may want C++.
This command line may work:
sudo apt-get <package>
Where <package> is the development environment package. I've no idea what a good package would be but an also interested in doing this sort of thing.
Then AIUI you need to install a suitable development environment. Python is there but you may want C++.
This command line may work:
sudo apt-get <package>
Where <package> is the development environment package. I've no idea what a good package would be but an also interested in doing this sort of thing.
- gordon@drogon.net
- Posts: 2023
- Joined: Tue Feb 07, 2012 2:14 pm
- Location: Devon, UK
- Contact: Website Twitter
Re: How do I run Debian for ARM in windows and compile code?
nemmi69 said:
Well i need to write software for a front end to an oscilloscope based around the Pi
There are several oscilloscope packages avalable under Linux (and the R-Pi is just another Linux box, afterall). Debian has xoscope for example, so I've no reason to suspect it won't be present in the R-Pi Debian image.
But - as it's just another Linux box, you would possibly be better off finding an old PC and installing Debian on it and using that to develop your software on, then you can move it to the R-Pi when you get it, type 'make' and off you go. That'll save the faff of cross compilers, QEMU, and whatever else.
As for what software would be best to write it in - that all depends on what you're after, and what you're interfacing to, and what you want to achive. If it's an existing oscilloscope with a serial or USB port, then you'll need to use a language that can talk directly to those ports... However I'd start by writing in in the language you're most familiar with. (unless it doesn't support the interface method)
Gordon
Well i need to write software for a front end to an oscilloscope based around the Pi
There are several oscilloscope packages avalable under Linux (and the R-Pi is just another Linux box, afterall). Debian has xoscope for example, so I've no reason to suspect it won't be present in the R-Pi Debian image.
But - as it's just another Linux box, you would possibly be better off finding an old PC and installing Debian on it and using that to develop your software on, then you can move it to the R-Pi when you get it, type 'make' and off you go. That'll save the faff of cross compilers, QEMU, and whatever else.
As for what software would be best to write it in - that all depends on what you're after, and what you're interfacing to, and what you want to achive. If it's an existing oscilloscope with a serial or USB port, then you'll need to use a language that can talk directly to those ports... However I'd start by writing in in the language you're most familiar with. (unless it doesn't support the interface method)
Gordon
--
Gordons projects: https://projects.drogon.net/
Gordons projects: https://projects.drogon.net/
Re: How do I run Debian for ARM in windows and compile code?
well all i have is the laptop and as i don't want to install Debian fully just have an emulator and work through that
- Jim Manley
- Posts: 1600
- Joined: Thu Feb 23, 2012 8:41 pm
- Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
- Contact: Website
Re: How do I run Debian for ARM in windows and compile code?
Read this thread to learn how to run an emulation of the R-Pi ARM hardware with Debian on QEmu, inside VirtualBox running on Windows:
http://www.raspberrypi.org/for.....-added-cow (Special thanks to nmcc for providing this!)
I verified it works under both Windows XP SP3 (32-bit) and 7 Home Premium (64-bit). You may need to reboot your Windows system to clear enough resources before launching the Debian virtual machine in VirtualBox (my Windows 7 system had been running for weeks and had all sorts of memory-leaky processes bumping along in the background).
Even if you cross-compile on another system, this will give you something to test run your code on to see pretty well how it should run on R-Pi hardware. If you plan to run Fedora, ArchLinux, Puppy, or another flavor other than Debian on your R-Pi, it is theoretically possible to run it under QEmu within VirtualBox on Windows, but, I haven"t looked to see if any of those has been tied up with as nice a bow as nmcc has done for Debian.
http://www.raspberrypi.org/for.....-added-cow (Special thanks to nmcc for providing this!)
I verified it works under both Windows XP SP3 (32-bit) and 7 Home Premium (64-bit). You may need to reboot your Windows system to clear enough resources before launching the Debian virtual machine in VirtualBox (my Windows 7 system had been running for weeks and had all sorts of memory-leaky processes bumping along in the background).
Even if you cross-compile on another system, this will give you something to test run your code on to see pretty well how it should run on R-Pi hardware. If you plan to run Fedora, ArchLinux, Puppy, or another flavor other than Debian on your R-Pi, it is theoretically possible to run it under QEmu within VirtualBox on Windows, but, I haven"t looked to see if any of those has been tied up with as nice a bow as nmcc has done for Debian.
The best things in life aren't things ... but, a Pi comes pretty darned close! 
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!
-
- Posts: 239
- Joined: Thu Jan 12, 2012 5:45 pm
Re: How do I run Debian for ARM in windows and compile code?
What's the benefit of running QEMU inside VirtualBox compared to running it straight from Windows?
Re: How do I run Debian for ARM in windows and compile code?
Chris Rowland said:
What's the benefit of running QEMU inside VirtualBox compared to running it straight from Windows?
I don't know if there is any.. I have followed the following instructions:
http://www.smallbulb.net/2012/.....spberry-pi
Runs QEMU direct from Windows, seems a much easier method than an emulator in an emulator.
What's the benefit of running QEMU inside VirtualBox compared to running it straight from Windows?
I don't know if there is any.. I have followed the following instructions:
http://www.smallbulb.net/2012/.....spberry-pi
Runs QEMU direct from Windows, seems a much easier method than an emulator in an emulator.
Re: How do I run Debian for ARM in windows and compile code?
Chris Rowland said:
What's the benefit of running QEMU inside VirtualBox compared to running it straight from Windows?
Once you have the images and everything works, there is no benefit.
But to make it the image work in qemu, it may be handy to have the Linux tools (e.g. to build the kernel...), although it could also probably be done with cygwin.
What's the benefit of running QEMU inside VirtualBox compared to running it straight from Windows?
Once you have the images and everything works, there is no benefit.
But to make it the image work in qemu, it may be handy to have the Linux tools (e.g. to build the kernel...), although it could also probably be done with cygwin.
- Jim Manley
- Posts: 1600
- Joined: Thu Feb 23, 2012 8:41 pm
- Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
- Contact: Website
Re: How do I run Debian for ARM in windows and compile code?
For complete novices, VirtualBox makes the process pretty much point-and-click and provides a simpler way to manage multiple environments in pretty much any OS except Mac OS X. I don"t know whether QEmu provides self-adjusting virtual disk volumes that appear to Windows as a single file that can be easily snapshotted/backed-up/restored/shared in Windows. Managing Windows host peripherals and resources is also very straightforward, which includes copy/paste between any VirtualBox emulation instance and Windows. VirtualBox can pause/archive/resume any virtual machine and the state of the machine can be restored and resumed on another system running VirtualBox. I don"t know how much of this also applies to QEmu.
The best things in life aren't things ... but, a Pi comes pretty darned close! 
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!
Re: How do I run Debian for ARM in windows and compile code?
I tried virtual box once before and had a problem where virtual box and windows argued over the wireless connection and in the end crashed the wi-fi
- nick.mccloud
- Posts: 1144
- Joined: Sat Feb 04, 2012 4:18 pm
Re: How do I run Debian for ARM in windows and compile code?
nemmi69 said:
I tried virtual box once before and had a problem where virtual box and windows argued over the wireless connection and in the end crashed the wi-fi
VirtualBox runs on millions of machines across the world and gets regularly updated - it might be worth another try - or search the forum for the VMware version I did.
I tried virtual box once before and had a problem where virtual box and windows argued over the wireless connection and in the end crashed the wi-fi
VirtualBox runs on millions of machines across the world and gets regularly updated - it might be worth another try - or search the forum for the VMware version I did.
Pico/RP2040 ≠ Arduino
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute
Pico = hot rod kit car, Arduino = hot rod kit car wrapped in cotton wool with buoyancy aids & parachute
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How do I run Debian for ARM in windows and compile code?
Allow me to put in a vote for the other side.
I don't see any reason to go the VirtualBox route. I understand the theory - that it is "download this - do that - boom!" - but I don't think it gains anything. The point is, you still have to download, install, configure VB itself. Personally, I've never used VB (used VMWare a lot, instead), so I wasn't keen on the idea of going the distance with a brand new virtualization software.
Further, it (obviously) adds another layer of complexity and resource use. If you are running on a resource-constrained machine (in today's lingo, "resource-constrained" means anything less than 4Gb RAM and/or less than dual-core 4GHz CPU), then obviously you may not want to endure the pain of emulator-within-emulator.
So, I recommend the "Run QEMU directly under Windows" approach. As I noted in another thread, if I can get it to work, it can't be that hard. Someone has already mentioned the "small bulb" URL that contains most of the info you need (everything except the networking). To the newbie, I say "Get it working without networking (-net none), then come back here for info on getting the networking working."
Finally, note that there are 3 (that I can think of) theoretical disadvantages to running QEMU under Windows, vs. running it under Linux. They are listed below, but I don't think any of them stand up to analysis as a real problem.
1) Networking doesn't work (natively). This is easily worked around by installing and using the TAP device for networking. Once you figure it out, there is no disadvantage to going this route.
2) The "-vnc" option doesn't work. But there's no need for this, since the graphics (the X GUI) is displayed natively on your Windows desktop.
3) The lack of the Linux development environment - for compiling your own kernel. But of course, the "complete newbie" (referenced upthread) isn't going to be compiling any kernels anyway, so this is a non-starter.
I don't see any reason to go the VirtualBox route. I understand the theory - that it is "download this - do that - boom!" - but I don't think it gains anything. The point is, you still have to download, install, configure VB itself. Personally, I've never used VB (used VMWare a lot, instead), so I wasn't keen on the idea of going the distance with a brand new virtualization software.
Further, it (obviously) adds another layer of complexity and resource use. If you are running on a resource-constrained machine (in today's lingo, "resource-constrained" means anything less than 4Gb RAM and/or less than dual-core 4GHz CPU), then obviously you may not want to endure the pain of emulator-within-emulator.
So, I recommend the "Run QEMU directly under Windows" approach. As I noted in another thread, if I can get it to work, it can't be that hard. Someone has already mentioned the "small bulb" URL that contains most of the info you need (everything except the networking). To the newbie, I say "Get it working without networking (-net none), then come back here for info on getting the networking working."
Finally, note that there are 3 (that I can think of) theoretical disadvantages to running QEMU under Windows, vs. running it under Linux. They are listed below, but I don't think any of them stand up to analysis as a real problem.
1) Networking doesn't work (natively). This is easily worked around by installing and using the TAP device for networking. Once you figure it out, there is no disadvantage to going this route.
2) The "-vnc" option doesn't work. But there's no need for this, since the graphics (the X GUI) is displayed natively on your Windows desktop.
3) The lack of the Linux development environment - for compiling your own kernel. But of course, the "complete newbie" (referenced upthread) isn't going to be compiling any kernels anyway, so this is a non-starter.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How do I run Debian for ARM in windows and compile code?
Also, one more thing I wanted to add to the previous:
This is the (one line) batch file that I use to launch QEMU (save this as "GO.BAT" and run it from a Command Prompt window in Windows):
:: All on one line, even it wraps in the browser
start /B Qemu-windows-1.0.1\qemu-system-arm.exe -M versatilepb -cpu arm1136-r2 -hda debian6-17-02-2012\debian6-17-02-2012.img -kernel zImage_3.1.9 -m 192 -append "root=/dev/sda2" -net nic -net tap,ifname=TAP
This is the (one line) batch file that I use to launch QEMU (save this as "GO.BAT" and run it from a Command Prompt window in Windows):
:: All on one line, even it wraps in the browser
start /B Qemu-windows-1.0.1\qemu-system-arm.exe -M versatilepb -cpu arm1136-r2 -hda debian6-17-02-2012\debian6-17-02-2012.img -kernel zImage_3.1.9 -m 192 -append "root=/dev/sda2" -net nic -net tap,ifname=TAP
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: How do I run Debian for ARM in windows and compile code?
I looked for the QEMU download in the link but didn't find it. this stuff is getting way confusing
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How do I run Debian for ARM in windows and compile code?
Which link?
Oops - I'm sorry. I think this page:
http://www.smallbulb.net/2012/.....spberry-pi
Contains a bad link for the QEMU software for Windows:
http://homepage3.nifty.com/tak.....indows.zip
I used:
http://lassauge.free.fr/qemu/
and, specifically:
http://lassauge.free.fr/qemu/r.....dows.zip
instead.
Oops - I'm sorry. I think this page:
http://www.smallbulb.net/2012/.....spberry-pi
Contains a bad link for the QEMU software for Windows:
http://homepage3.nifty.com/tak.....indows.zip
I used:
http://lassauge.free.fr/qemu/
and, specifically:
http://lassauge.free.fr/qemu/r.....dows.zip
instead.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: How do I run Debian for ARM in windows and compile code?
Loaded OK
Used that batch file but it says cannot find Qemu-windows-1.0.1\qemu-system-arm.exe added c:\ in front no error message but doesn't do anything.
Used that batch file but it says cannot find Qemu-windows-1.0.1\qemu-system-arm.exe added c:\ in front no error message but doesn't do anything.
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How do I run Debian for ARM in windows and compile code?
I have not given step-by-step, newbie-proof instructions. You will have to work out the directory structures and file placements yourself, and, yes, I am assuming some DOS/Windows command-line knowledge.
Also, until you have the TAP device installed (that's the next lesson), change the last two parameters (the two -net params) to just:
-net none
P.S. Re: not getting any error message. Yes, I could have added that as #4 in my list of "things that don't work in the Windows version vs. the Linux version" - namely, that when you give it a command line it doesn't like, the Windows version just exits silently w/o any error message, while the Linux version gives you some sort of error message (*).
(*) Or at least I think it does. It has been a while since I've run QEMU under Linux.
Also, until you have the TAP device installed (that's the next lesson), change the last two parameters (the two -net params) to just:
-net none
P.S. Re: not getting any error message. Yes, I could have added that as #4 in my list of "things that don't work in the Windows version vs. the Linux version" - namely, that when you give it a command line it doesn't like, the Windows version just exits silently w/o any error message, while the Linux version gives you some sort of error message (*).
(*) Or at least I think it does. It has been a while since I've run QEMU under Linux.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: How do I run Debian for ARM in windows and compile code?
cheers so far and putting up with a newbie
Found a file called stderr.txt which appears in the QEMU directory and it tells you whats wrong.
Mine is "zImage_3.1.9: No such file or directory" so what is zimage?
Found a file called stderr.txt which appears in the QEMU directory and it tells you whats wrong.
Mine is "zImage_3.1.9: No such file or directory" so what is zimage?
Re: How do I run Debian for ARM in windows and compile code?
found it and QEMU loads.
user pi
password suse
After you log in run “startx” to enter the graphical environment.
user pi
password suse
After you log in run “startx” to enter the graphical environment.
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How do I run Debian for ARM in windows and compile code?
1) The URL to download the kernel is given in the "small bulb" site. Look it up there.
2) What I did was to create a directory, C:\RaspberryPi, off the root, then populate it with:
4 drwxr-xr-x 1 ... 2,048 Mar 23 06:23 Qemu-windows-1.0.1
4 drwxr-xr-x 1 ... 2,048 Mar 13 12:01 debian6-17-02-2012
4 -rwxr-xr-x 1 ... 209 Mar 22 18:12 go.bat
4 -rwxr-xr-x 1 ... 241 Mar 13 13:31 xorg.conf
4040 -rwxr-xr-x 1 ... 2,066,560 Mar 13 11:25 zImage_3.1.9
The point is that the zImage file has to be in the current (same) directory when you launch GO.BAT.
Also, you will need the xorg.conf file later on, in order to get the X GUI running at a decent screen resolution. Here is the contents of that file:
# Create the file "/etc/X11/xorg.conf" (as root, real or sudo)
# with the following content:
Section "Screen"
Identifier "Default Screen"
DefaultDepth 16
SubSection "Display"
# Viewport 0 0
Depth 16
Modes "800x600"
EndSubsection
EndSection
2) What I did was to create a directory, C:\RaspberryPi, off the root, then populate it with:
4 drwxr-xr-x 1 ... 2,048 Mar 23 06:23 Qemu-windows-1.0.1
4 drwxr-xr-x 1 ... 2,048 Mar 13 12:01 debian6-17-02-2012
4 -rwxr-xr-x 1 ... 209 Mar 22 18:12 go.bat
4 -rwxr-xr-x 1 ... 241 Mar 13 13:31 xorg.conf
4040 -rwxr-xr-x 1 ... 2,066,560 Mar 13 11:25 zImage_3.1.9
The point is that the zImage file has to be in the current (same) directory when you launch GO.BAT.
Also, you will need the xorg.conf file later on, in order to get the X GUI running at a decent screen resolution. Here is the contents of that file:
# Create the file "/etc/X11/xorg.conf" (as root, real or sudo)
# with the following content:
Section "Screen"
Identifier "Default Screen"
DefaultDepth 16
SubSection "Display"
# Viewport 0 0
Depth 16
Modes "800x600"
EndSubsection
EndSection
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)