[gem5-users] Re: Gem5 FS mode exit after booting

2022-03-17 Thread Bobby Bruce via gem5-users
First, please in future just copy and paste the text/error messages.
Screenshots are inefficient and make email threads such as this difficult
for future users to search.

Nikos is correct, your boot is working as intended, but I'll expand the
answer to help you in your work.

I notice you're using gem5 v21.0.0.0. This version of gem5 is a year old
and we've made significant improvements to the tool since then. The current
release of gem5 is v21.2.1.0. I strongly recommend you use this version.
You can get this by cloning the repo and compiling what you find at the
HEAD of the "stable" branch.

I know this is very confusing but the files under
http://gem5.org/dist/current/ are legacy files and were only known to work
for gem5 v19 (sidenote: this is totally my fault for calling this directory
"current" and due to various links being passed around since then, it's
stuck). The files you really want will be under http://gem5.org/dist/v21-2
for the v21.2 release, or http://gem5.org/dist/v21-0 for the v21.0 release
you're using.

The easiest way to do an x86 FS boot in v21.2 would be to do the following:

```
scons build/X86/gem5.opt -j `nproc`
./build/X86/gem5.opt configs/example/gem5_library/x86-ubuntu-run.py
```

This will automatically download the kernel and the disk image you need to
run the simulation. It will also exit after boot. The only thing you need
to keep in mind here is this uses the X86DemoBoard, which holds no
guarantees to be representative of real-world targets.

You can do some limit stuff after boot if you want, you can change the
x86-ubuntu-run.py line to something like:

```
board.set_kernel_disk_workload(

kernel=Resource("x86-linux-kernel-5.4.49"),

disk_image=Resource("x86-ubuntu-18.04-img"),
readfile_contents="echo 'hello'",
)
```
This will print "Hello" after boot instead of exiting. If you want
something more substantial you'll need to create your own disk image. We
provide some, most of of which have example scripts you can find under
"configs/example/gem5_library".  More information on using the gem5
standard library can be found here:
https://www.gem5.org/documentation/gem5-stdlib/overview

Kind regards,
Bobby
--
Dr. Bobby R. Bruce
Room 3050,
Kemper Hall, UC Davis
Davis,
CA, 95616

web: https://www.bobbybruce.net


On Thu, Mar 17, 2022 at 11:41 AM Eliot Moss via gem5-users <
gem5-users@gem5.org> wrote:

>
> ... and I'll just add that often folks want to have gem5 simulate the boot
> sequence and then take a checkpoint.  That checkpoint can be used over and
> over to run from that point in the simulation, skipping the time taken to
> boot.  In one of my setups this save 15-20 mins for each run.
>
> Regards - Eliot Moss
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Gem5 FS mode exit after booting

2022-03-17 Thread Eliot Moss via gem5-users



... and I'll just add that often folks want to have gem5 simulate the boot
sequence and then take a checkpoint.  That checkpoint can be used over and
over to run from that point in the simulation, skipping the time taken to
boot.  In one of my setups this save 15-20 mins for each run.

Regards - Eliot Moss
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-users] Re: Gem5 FS mode exit after booting

2022-03-17 Thread Νικόλαος Ταμπουρατζής via gem5-users

Dear Waliullah,

I think that the image has a gem5_init script that executes the m5  
exit command. You can use the image from gem5 resources  
(http://dist.gem5.org/dist/v21-2/images/x86/ubuntu-18-04/x86-ubuntu.img.gz)  
with vmlinux-5.4.49 kernel  
(http://dist.gem5.org/dist/v21-2/kernels/x86/static/vmlinux-5.4.49).  
Then you need to emulate the image and change the gem5_init.sh in  
order to get the terminal:


sudo apt-get install qemu qemu-user-static qemu-user
sudo mount -o loop,offset=1048576  
$HOME/COSSIM/kernels/disks/x86-ubuntu.img /mnt

cd /mnt
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo chroot .

nano root/gem5_init.sh #Change the line 21 from m5 exit to /bin/sh

exit
# now we are back to the host system
cd
sudo umount /mnt/proc
sudo umount /mnt/dev
sudo umount /mnt


Now you can simulate using the gem5.

Best regards,
Nikos




Quoting Waliullah Mridha via gem5-users :


Hi,
I am a new user trying to run Gem5 in FS mode. My command line is  
given bellow. I also attached a terminal to see the output.  
Everything looks good except Gem5 exit after the boot process  
finishes. On Gem5 run terminal I got the message  
"[cid:image004.png@01D8394B.885BD600]".
Shouldn't I see a linux command prompt in the attached terminal  
instead of exiting after boot complete.
Just wondering if the disk image I am using (downloaded from  
gs://dist/gem5.org/dist/current/images/x86) has any init script that  
causes this exit?

Appreciate your help.
Thanks

Here is my command line.
[cid:image002.png@01D8394B.885BD600]

Here is the output from gem5:
[cid:image003.png@01D8394B.885BD600]
.
.
[cid:image004.png@01D8394B.885BD600]


Here is the output from the terminal:
.
.
[cid:image001.png@01D8394C.E5439960]



___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s