All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] minimal linux distribution for qemu
@ 2013-08-15  8:57 Herbei Dacian
  2013-08-15 11:53 ` Andreas Färber
  2013-08-15 12:09 ` Stefan Hajnoczi
  0 siblings, 2 replies; 20+ messages in thread
From: Herbei Dacian @ 2013-08-15  8:57 UTC (permalink / raw)
  To: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]


hi,
please, can anyone recommend me a distribution that offers a barebone linux kernel.
minimum that I need on that image are:
_ the kernel
_ the compiler and development infrastructure to build it
regards,
dacian

[-- Attachment #2: Type: text/html, Size: 390 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15  8:57 [Qemu-devel] minimal linux distribution for qemu Herbei Dacian
@ 2013-08-15 11:53 ` Andreas Färber
  2013-08-16 15:59   ` Rob Landley
  2013-08-15 12:09 ` Stefan Hajnoczi
  1 sibling, 1 reply; 20+ messages in thread
From: Andreas Färber @ 2013-08-15 11:53 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

Hi,

Am 15.08.2013 10:57, schrieb Herbei Dacian:
> 
> please, can anyone recommend me a distribution that offers a barebone
> linux kernel.
> minimum that I need on that image are:
> _ the kernel
> _ the compiler and development infrastructure to build it

Aboriginal Linux.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15  8:57 [Qemu-devel] minimal linux distribution for qemu Herbei Dacian
  2013-08-15 11:53 ` Andreas Färber
@ 2013-08-15 12:09 ` Stefan Hajnoczi
  2013-08-15 13:22   ` Herbei Dacian
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2013-08-15 12:09 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

On Thu, Aug 15, 2013 at 09:57:09AM +0100, Herbei Dacian wrote:
> please, can anyone recommend me a distribution that offers a barebone linux kernel.
> minimum that I need on that image are:
> _ the kernel
> _ the compiler and development infrastructure to build it

If you want something small and customizable, try Tiny Core Linux:

http://www.tinycorelinux.net/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 12:09 ` Stefan Hajnoczi
@ 2013-08-15 13:22   ` Herbei Dacian
  2013-08-15 13:31     ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Herbei Dacian @ 2013-08-15 13:22 UTC (permalink / raw)
  To: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]


In the end I went for debian cause it is widely used.

So I'm using the following command to install linux:
qemu-system-arm -m 1024 -hda arm.img -cdrom debian-7.1.0-armel-CD-1.iso -boot d

And I get this error:
Kernel image must be specified

In the documentation is mentioned that i don't need a bzImage if the CD is bootable.
any suggestions?

[-- Attachment #2: Type: text/html, Size: 690 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 13:22   ` Herbei Dacian
@ 2013-08-15 13:31     ` Peter Maydell
  2013-08-15 13:46       ` Herbei Dacian
  0 siblings, 1 reply; 20+ messages in thread
From: Peter Maydell @ 2013-08-15 13:31 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

On 15 August 2013 14:22, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
>
> In the end I went for debian cause it is widely used.
>
> So I'm using the following command to install linux:
> qemu-system-arm -m 1024 -hda arm.img -cdrom debian-7.1.0-armel-CD-1.iso
> -boot d

This command line is totally broken. You're running
(by default) an emulation of the 'integratorcp' board (which is
pretty much obsolete and a bad choice), and you're trying to
pass it a CDROM image, when the board doesn't have a CDROM
drive. You need to specify the right board to emulate (with
'-M something' and also pass a kernel and an initrd to load
(with -kernel and -initrd).

-- PMM

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 13:31     ` Peter Maydell
@ 2013-08-15 13:46       ` Herbei Dacian
  2013-08-15 13:48         ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Herbei Dacian @ 2013-08-15 13:46 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]


OK but which command should I use if that is broken and where I can find some documentation that is actually up to date?



________________________________
 From: Peter Maydell <peter.maydell@linaro.org>
To: Herbei Dacian <dacian_herbei@yahoo.fr> 
Cc: QEmu Devel <qemu-devel@nongnu.org> 
Sent: Thursday, 15 August 2013, 15:31
Subject: Re: [Qemu-devel] minimal linux distribution for qemu
 

On 15 August 2013 14:22, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
>
> In the end I went for debian cause it is widely used.
>
> So I'm using the following command to install linux:
> qemu-system-arm -m 1024 -hda arm.img -cdrom debian-7.1.0-armel-CD-1.iso
> -boot d

This command line is totally broken. You're running
(by default) an emulation of the 'integratorcp' board (which is
pretty much obsolete and a bad choice), and you're trying to
pass it a CDROM image, when the board doesn't have a CDROM
drive. You need to specify the right board to emulate (with
'-M something' and also pass a kernel and an initrd to load
(with -kernel and -initrd).

-- PMM

[-- Attachment #2: Type: text/html, Size: 1904 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 13:46       ` Herbei Dacian
@ 2013-08-15 13:48         ` Peter Maydell
  2013-08-15 14:01           ` Herbei Dacian
  0 siblings, 1 reply; 20+ messages in thread
From: Peter Maydell @ 2013-08-15 13:48 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

On 15 August 2013 14:46, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
> OK but which command should I use if that is broken and where I can find
> some documentation that is actually up to date?

You need to start by finding out which of the boards QEMU
models your distribution actually supports, and the expected
install method for them. ARM is *not* like x86 here -- all x86
systems are basically identical, but all ARM boards are
different and you need the correct kernel for the board you're
running, whether that board is real hardware or emulated.

-- PMM

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 13:48         ` Peter Maydell
@ 2013-08-15 14:01           ` Herbei Dacian
  2013-08-15 14:05             ` Peter Maydell
  2013-08-16 16:05             ` Rob Landley
  0 siblings, 2 replies; 20+ messages in thread
From: Herbei Dacian @ 2013-08-15 14:01 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]


yes but which binary do I use to call to run an emulated arm image?

is there an actual binary that can emulate an existing arm board, anyboard?
qemu?
if not which is the emulator that works with arm?
If not where is the project that I can tweak to build such a binary.


I can search for the board that is not a problem and then I can tweak the project but I need to know where can I find this.
I couldn't find any documentation in this direction.



________________________________
 From: Peter Maydell <peter.maydell@linaro.org>
To: Herbei Dacian <dacian_herbei@yahoo.fr> 
Cc: QEmu Devel <qemu-devel@nongnu.org> 
Sent: Thursday, 15 August 2013, 15:48
Subject: Re: [Qemu-devel] minimal linux distribution for qemu
 

On 15 August 2013 14:46, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
> OK but which command should I use if that is broken and where I can find
> some documentation that is actually up to date?

You need to start by finding out which of the boards QEMU
models your distribution actually supports, and the expected
install method for them. ARM is *not* like x86 here -- all x86
systems are basically identical, but all ARM boards are
different and you need the correct kernel for the board you're
running, whether that board is real hardware or emulated.

-- PMM

[-- Attachment #2: Type: text/html, Size: 2504 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 14:01           ` Herbei Dacian
@ 2013-08-15 14:05             ` Peter Maydell
  2013-08-15 14:18               ` Herbei Dacian
  2013-08-16 16:05             ` Rob Landley
  1 sibling, 1 reply; 20+ messages in thread
From: Peter Maydell @ 2013-08-15 14:05 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

On 15 August 2013 15:01, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
> yes but which binary do I use to call to run an emulated arm image?

qemu-system-arm.

> is there an actual binary that can emulate an existing arm board, anyboard?

"qemu-system-arm -M help" lists the boards we support.

http://www.aurel32.net/info/debian_arm_qemu.php is a good howto
type document.

-- PMM

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 14:05             ` Peter Maydell
@ 2013-08-15 14:18               ` Herbei Dacian
  2013-08-15 14:22                 ` Peter Maydell
  2013-08-16 16:21                 ` Rob Landley
  0 siblings, 2 replies; 20+ messages in thread
From: Herbei Dacian @ 2013-08-15 14:18 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]


but you said that "qemu-system-arm" is not maintained and it doesn't work.

The link below contains only links to kernel images that don't work.
Anyway I'll figure it somehow cause this doesn't help me.



________________________________
 From: Peter Maydell <peter.maydell@linaro.org>
To: Herbei Dacian <dacian_herbei@yahoo.fr> 
Cc: QEmu Devel <qemu-devel@nongnu.org> 
Sent: Thursday, 15 August 2013, 16:05
Subject: Re: [Qemu-devel] minimal linux distribution for qemu
 

On 15 August 2013 15:01, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
> yes but which binary do I use to call to run an emulated arm image?

qemu-system-arm.

> is there an actual binary that can emulate an existing arm board, anyboard?

"qemu-system-arm -M help" lists the boards we support.

http://www.aurel32.net/info/debian_arm_qemu.php is a good howto
type document.

-- PMM

[-- Attachment #2: Type: text/html, Size: 1953 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 14:18               ` Herbei Dacian
@ 2013-08-15 14:22                 ` Peter Maydell
  2013-08-16 16:21                 ` Rob Landley
  1 sibling, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2013-08-15 14:22 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

On 15 August 2013 15:18, Herbei Dacian <dacian_herbei@yahoo.fr> wrote:
> but you said that "qemu-system-arm" is not maintained and it doesn't work.

No, I said that the arguments you were giving it were requesting a
model of an obsolete board, and you should ask it to emulate a
different board.

-- PMM

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 11:53 ` Andreas Färber
@ 2013-08-16 15:59   ` Rob Landley
  2013-08-16 16:06     ` Herbei Dacian
  0 siblings, 1 reply; 20+ messages in thread
From: Rob Landley @ 2013-08-16 15:59 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Herbei Dacian, QEmu Devel

On 08/15/2013 06:53:30 AM, Andreas Färber wrote:
> Hi,
> 
> Am 15.08.2013 10:57, schrieb Herbei Dacian:
> >
> > please, can anyone recommend me a distribution that offers a  
> barebone
> > linux kernel.
> > minimum that I need on that image are:
> > _ the kernel
> > _ the compiler and development infrastructure to build it
> 
> Aboriginal Linux.
> 
> Andreas

Aboriginal actually comes with qemu launch scripts for each target.  
./run-emulator.sh is just the qemu command line, ./dev-environment.sh  
is a wrappe around that providing a better development enviornment  
(more memory and disk space). It's all described at  
http://landley.net/aboriginal/about.html

Try this:

   wget http://landley.net/aboriginal/bin/system-image-armv5l.tar.bz2
   tar xvjf system-image-armv5l.tar.bz2
   cd system-image.armv5l
   ./run-emulator.sh

   gcc /usr/src/thread-hello2.c -lpthread
   ./a.out
   exit

Thanks,

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 14:01           ` Herbei Dacian
  2013-08-15 14:05             ` Peter Maydell
@ 2013-08-16 16:05             ` Rob Landley
  2013-08-16 16:17               ` Herbei Dacian
  1 sibling, 1 reply; 20+ messages in thread
From: Rob Landley @ 2013-08-16 16:05 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: Peter Maydell, QEmu Devel

On 08/15/2013 09:01:19 AM, Herbei Dacian wrote:
> 
> yes but which binary do I use to call to run an emulated arm image?
> 
> is there an actual binary that can emulate an existing arm board,  
> anyboard?
> qemu?
> if not which is the emulator that works with arm?
> If not where is the project that I can tweak to build such a binary.

The arm versatilepb emulation can accept a range of processors (I've  
tried armv4, armv4t, armv5, armv6, and armv7), provides a PCI bus with  
a virtual hard drive controller and network card, and can accept 256  
megs of ram. (In theory it can accept more but I have to get the  
discontiguous memory stuff to work, haven't done that yet.)

That's the one I used in Aboriginal Linux arm images.

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-16 15:59   ` Rob Landley
@ 2013-08-16 16:06     ` Herbei Dacian
  0 siblings, 0 replies; 20+ messages in thread
From: Herbei Dacian @ 2013-08-16 16:06 UTC (permalink / raw)
  To: Rob Landley, Andreas Färber; +Cc: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

Thanks Rob I think that should do it for me.





________________________________
 From: Rob Landley <rob@landley.net>
To: Andreas Färber <afaerber@suse.de> 
Cc: Herbei Dacian <dacian_herbei@yahoo.fr>; QEmu Devel <qemu-devel@nongnu.org> 
Sent: Friday, 16 August 2013, 17:59
Subject: Re: [Qemu-devel] minimal linux distribution for qemu
 

On 08/15/2013 06:53:30 AM, Andreas Färber wrote:
> Hi,
> 
> Am 15.08.2013 10:57, schrieb Herbei Dacian:
> >
> > please, can anyone recommend me a distribution that offers a  
> barebone
> > linux kernel.
> > minimum that I need on that image are:
> > _ the kernel
> > _ the compiler and development infrastructure to build it
> 
> Aboriginal Linux.
> 
> Andreas

Aboriginal actually comes with qemu launch scripts for each target.  
./run-emulator.sh is just the qemu command line, ./dev-environment.sh  
is a wrappe around that providing a better development enviornment  
(more memory and disk space). It's all described at  
http://landley.net/aboriginal/about.html

Try this:

   wget http://landley.net/aboriginal/bin/system-image-armv5l.tar.bz2
   tar xvjf system-image-armv5l.tar.bz2
   cd system-image.armv5l
   ./run-emulator.sh

   gcc /usr/src/thread-hello2.c -lpthread
   ./a.out
   exit

Thanks,

Rob

[-- Attachment #2: Type: text/html, Size: 2370 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-16 16:05             ` Rob Landley
@ 2013-08-16 16:17               ` Herbei Dacian
  2013-08-16 17:46                 ` Andreas Färber
  2013-08-18  5:00                 ` Rob Landley
  0 siblings, 2 replies; 20+ messages in thread
From: Herbei Dacian @ 2013-08-16 16:17 UTC (permalink / raw)
  To: Rob Landley; +Cc: Peter Maydell, QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

my system should run in far less memory. something like 2-4MB.
but first I need to have a system running so that I can monitor with qemu the addresses accessed for read execute and write by the code run by the emulator.
if I reach that is a real big deal.
dacian




________________________________
 From: Rob Landley <rob@landley.net>
To: Herbei Dacian <dacian_herbei@yahoo.fr> 
Cc: Peter Maydell <peter.maydell@linaro.org>; QEmu Devel <qemu-devel@nongnu.org> 
Sent: Friday, 16 August 2013, 18:05
Subject: Re: [Qemu-devel] minimal linux distribution for qemu
 

On 08/15/2013 09:01:19 AM, Herbei Dacian wrote:
> 
> yes but which binary do I use to call to run an emulated arm image?
> 
> is there an actual binary that can emulate an existing arm board,  
> anyboard?
> qemu?
> if not which is the emulator that works with arm?
> If not where is the project that I can tweak to build such a binary.

The arm versatilepb emulation can accept a range of processors (I've  
tried armv4, armv4t, armv5, armv6, and armv7), provides a PCI bus with  
a virtual hard drive controller and network card, and can accept 256  
megs of ram. (In theory it can accept more but I have to get the  
discontiguous memory stuff to work, haven't done that yet.)

That's the one I used in Aboriginal Linux arm images.

Rob

[-- Attachment #2: Type: text/html, Size: 2136 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-15 14:18               ` Herbei Dacian
  2013-08-15 14:22                 ` Peter Maydell
@ 2013-08-16 16:21                 ` Rob Landley
  1 sibling, 0 replies; 20+ messages in thread
From: Rob Landley @ 2013-08-16 16:21 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: Peter Maydell, QEmu Devel

On 08/15/2013 09:18:48 AM, Herbei Dacian wrote:
> 
> but you said that "qemu-system-arm" is not maintained and it doesn't  
> work.

Who said that?

git log --pretty=format:"%h %ci %s" hw/arm

be2f78b 2013-08-05 11:46:58 -0500 pxa2xx: Avoid  
object_get_link_property() asser
cfc6b24 2013-07-29 21:06:27 +0200 versatilepb: QOM cast cleanup for  
vpb_sic_stat
0ca8187 2013-07-29 21:06:27 +0200 strongarm: QOM cast cleanup for  
StrongARMSSPSt
fff3af9 2013-07-29 21:06:27 +0200 strongarm: QOM cast cleanup for  
StrongARMUARTS

Something like 50 commits to hw/arm last month alone, and August was  
feature freeze for the 1.6.0 release. (If it _wasn't_ actively  
developed I wouldn't have had to work around a darn IRQ routing issue  
on the arm target in the last Aboriginal release...)

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-16 16:17               ` Herbei Dacian
@ 2013-08-16 17:46                 ` Andreas Färber
  2013-08-18  5:00                 ` Rob Landley
  1 sibling, 0 replies; 20+ messages in thread
From: Andreas Färber @ 2013-08-16 17:46 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: Peter Maydell, qemu-devel

Am 16.08.2013 18:17, schrieb Herbei Dacian:
> my system should run in far less memory. something like 2-4MB.

I thought either 16MB or 64MB RAM was a lower limit for uCLinux?

If you want to write your own custom firmware then you can go pretty low
of course. For low-end ARM embedded development the two Stellaris
machines (Cortex-M3) might be a good starting point in that case.

Andreas

P.S. Please avoid top-posting and HTML on this mailing list.

> but first I need to have a system running so that I can monitor with
> qemu the addresses accessed for read execute and write by the code run
> by the emulator.
> if I reach that is a real big deal.
> dacian
> 
> 
> ------------------------------------------------------------------------
> *From:* Rob Landley <rob@landley.net>
> *To:* Herbei Dacian <dacian_herbei@yahoo.fr>
> *Cc:* Peter Maydell <peter.maydell@linaro.org>; QEmu Devel
> <qemu-devel@nongnu.org>
> *Sent:* Friday, 16 August 2013, 18:05
> *Subject:* Re: [Qemu-devel] minimal linux distribution for qemu
> 
> On 08/15/2013 09:01:19 AM, Herbei Dacian wrote:
>>
>> yes but which binary do I use to call to run an emulated arm image?
>>
>> is there an actual binary that can emulate an existing arm board, 
>> anyboard?
>> qemu?
>> if not which is the emulator that works with arm?
>> If not where is the project that I can tweak to build such a binary.
> 
> The arm versatilepb emulation can accept a range of processors (I've 
> tried armv4, armv4t, armv5, armv6, and armv7), provides a PCI bus with 
> a virtual hard drive controller and network card, and can accept 256 
> megs of ram. (In theory it can accept more but I have to get the 
> discontiguous memory stuff to work, haven't done that yet.)
> 
> That's the one I used in Aboriginal Linux arm images.
> 
> Rob
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-16 16:17               ` Herbei Dacian
  2013-08-16 17:46                 ` Andreas Färber
@ 2013-08-18  5:00                 ` Rob Landley
  2013-08-18 13:57                   ` Herbei Dacian
  1 sibling, 1 reply; 20+ messages in thread
From: Rob Landley @ 2013-08-18  5:00 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: Peter Maydell, QEmu Devel

On 08/16/2013 11:17:06 AM, Herbei Dacian wrote:
> my system should run in far less memory. something like 2-4MB.
> but first I need to have a system running so that I can monitor with  
> qemu the addresses accessed for read execute and write by the code  
> run by the emulator.
> if I reach that is a real big deal.
> dacian

Linux 2.6 and later won't run in 2 megs at all. You can trim it down to  
4 megs on a nommu system (the page tables take up too much ram  
otherwise), but won't be able to do much.

Really, things like kobjects in the modern kernel take up too much  
space. Getting anything to work in 4 megs requires diabling all the  
printk strings at compile time. (The last time I saw somebody do a 4  
meg system was CELF in 2006. 32 bit x86.)

Look at the uClinux project. Or try to bolt your app onto uboot and run  
it on the bare metal.

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-18  5:00                 ` Rob Landley
@ 2013-08-18 13:57                   ` Herbei Dacian
  2013-08-20  8:38                     ` Rob Landley
  0 siblings, 1 reply; 20+ messages in thread
From: Herbei Dacian @ 2013-08-18 13:57 UTC (permalink / raw)
  To: Rob Landley; +Cc: QEmu Devel

[-- Attachment #1: Type: text/plain, Size: 2344 bytes --]


good to know.
I was working back in 2005-2006 with a company that had a 4MB kernel.
At that time I was too inexperienced to work at that level but I thought now I could reproduce their work with some help.
Anyhow for the moment I'll go for 256 MB of ram board just so that I don't worry too much about things that are not yet relevant for me.
But thanks again for the warning.
But since you helped me soo much I have another question.
Is it fisible to change the emulator so that I may visualize the following aspects:
_ address of the currently executed instruction from the guest system
_ if this instruction is a form of jump like call return conditional jump.
_ the address or range of addresses read by this instruction
_ the address or range of addresses written by this instruction

I read some things about the emulator and if I understood it correctly the emulator breaks the instructions of the gurest platform in micro ops which are then executed on the host operation system.
So I'm asking the question above in the idea that maybe there is also somekind of reordering of these micro instructions.
best regards,
dacian




________________________________
 From: Rob Landley <rob@landley.net>
To: Herbei Dacian <dacian_herbei@yahoo.fr> 
Cc: Peter Maydell <peter.maydell@linaro.org>; QEmu Devel <qemu-devel@nongnu.org> 
Sent: Sunday, 18 August 2013, 8:00
Subject: Re: [Qemu-devel] minimal linux distribution for qemu
 

On 08/16/2013 11:17:06 AM, Herbei Dacian wrote:
> my system should run in far less memory. something like 2-4MB.
> but first I need to have a system running so that I can monitor with  
> qemu the addresses accessed for read execute and write by the code  
> run by the emulator.
> if I reach that is a real big deal.
> dacian

Linux 2.6 and later won't run in 2 megs at all. You can trim it down to  
4 megs on a nommu system (the page tables take up too much ram  
otherwise), but won't be able to do much.

Really, things like kobjects in the modern kernel take up too much  
space. Getting anything to work in 4 megs requires diabling all the  
printk strings at compile time. (The last time I saw somebody do a 4  
meg system was CELF in 2006. 32 bit x86.)

Look at the uClinux project. Or try to bolt your app onto uboot and run  
it on the bare metal.

Rob

[-- Attachment #2: Type: text/html, Size: 3184 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] minimal linux distribution for qemu
  2013-08-18 13:57                   ` Herbei Dacian
@ 2013-08-20  8:38                     ` Rob Landley
  0 siblings, 0 replies; 20+ messages in thread
From: Rob Landley @ 2013-08-20  8:38 UTC (permalink / raw)
  To: Herbei Dacian; +Cc: QEmu Devel

On 08/18/2013 08:57:08 AM, Herbei Dacian wrote:
> 
> good to know.
> I was working back in 2005-2006 with a company that had a 4MB kernel.
> At that time I was too inexperienced to work at that level but I  
> thought now I could reproduce their work with some help.
> Anyhow for the moment I'll go for 256 MB of ram board just so that I  
> don't worry too much about things that are not yet relevant for me.
> But thanks again for the warning.
> But since you helped me soo much I have another question.
> Is it fisible to change the emulator so that I may visualize the  
> following aspects:
> _ address of the currently executed instruction from the guest system
> _ if this instruction is a form of jump like call return conditional  
> jump.
> _ the address or range of addresses read by this instruction
> _ the address or range of addresses written by this instruction

If you feed qemu the -s option it'll open a network port you can  
connect to to provide the gdbserver protocol (gdb's "target remote"  
command attaches to this). For system emulation it acts like a jtag  
attached to the emulated hardware, letting you see registers and such.

> I read some things about the emulator and if I understood it  
> correctly the emulator
> breaks the instructions of the gurest platform in micro ops which are  
> then executed
> on the host operation system.

Not really, no.

QEMU translates large blocks of code (used to be pages, now it's  
variable sized chunks depending on where the return instruction is) and  
keeps the translated versions cached (sort of like a java JIT). The  
main QEMU loop then calls the translated functions which execute until  
they return or get interrupted by signals (simulating things like timer  
IRQ). This is why QEMU is so fast, the actual translation overhead is  
amortized by the resulting native code being run lots of times, a  
function or loop gets translated once and then runs as native code.

This means that "the address of the currently executing instruction"  
isn't really something qemu naturally tracks, because although there  
_is_ a copy of the untranslated code page, it's not what we're running.  
The gdbserver code tries to do so artifically, but it's slow and  
awkward and not always perfect.

Self-modifying code is actually a horrible thing to do to qemu, from a  
performance perspective. Every time the emulated code page is modified,  
the cached copy of the translated code is discarded and the entire page  
gets retranslated. This means that in Aboriginal Linux, the shell  
scripts ./configure runs sped up 20% when I replaced my dynamically  
linked busybox with a statically linked one, due to the extra  
translations caused by the relocation fixups.

Rob

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-08-20 10:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15  8:57 [Qemu-devel] minimal linux distribution for qemu Herbei Dacian
2013-08-15 11:53 ` Andreas Färber
2013-08-16 15:59   ` Rob Landley
2013-08-16 16:06     ` Herbei Dacian
2013-08-15 12:09 ` Stefan Hajnoczi
2013-08-15 13:22   ` Herbei Dacian
2013-08-15 13:31     ` Peter Maydell
2013-08-15 13:46       ` Herbei Dacian
2013-08-15 13:48         ` Peter Maydell
2013-08-15 14:01           ` Herbei Dacian
2013-08-15 14:05             ` Peter Maydell
2013-08-15 14:18               ` Herbei Dacian
2013-08-15 14:22                 ` Peter Maydell
2013-08-16 16:21                 ` Rob Landley
2013-08-16 16:05             ` Rob Landley
2013-08-16 16:17               ` Herbei Dacian
2013-08-16 17:46                 ` Andreas Färber
2013-08-18  5:00                 ` Rob Landley
2013-08-18 13:57                   ` Herbei Dacian
2013-08-20  8:38                     ` Rob Landley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.