mr.q | 14 Jan 08:24 2016
Picon

[uml-user] reboot guest OS ??? is it possible ?

Hello all,

I recently investigate on UML, and i have a little issue with the way system
reboots. (btw i dont know if this the way to go *really*)

My config is for host: debian jessie out of the box..
for guest OS i try several kernel and filesytstem but both hangs with the same
issues:
FS1 : debootstraped fs from Debian jessie
FS2 : devloop.org.uk filesystem Debian jessie.

Kernel1: 3.16 custom compiled kernel (.config from devloop.uk.org)
Kernel2: linux.uml debian kernel from package user-mode-linux
Kernel3: compiled devloop.uk.org kernel 3.18

if i launch 1 station and reboot from the guest OS shell, i saw on the host a
uml_watchdog process that seems to kill my guest OS few seconds after...

I cant find any documentation concerning this uml_watchdog, can't figure out how
it spawn from guest OS reboot...

but i am quite sure it is the culprit since copying /bin/true
to /usr/bin/uml_watchdog solve the issue... however i still have defunct process
(ex uml_watchdog).

The source of this uml_watchdog.c i found on internet doesnt make me much sense
since it looks like just looking from input on stdin ?.

Btw UML Watchdog timer is enabled on the guest OS.. not sure it is correctly
running since the quest OS complains about error on device 130 which is
(Continue reading)

Ricardo Nunes | 24 Nov 17:30 2015
Picon
Gravatar

[uml-user] New IRQ support

I've already made that question a few weeks ago but I couldn't make it work.

So, in order to support new IRQs I understand that we need to follow those steps:

  1. Add the IRQ IDs to /kernel/arch/um/include/asm/irq.h, or at least change LAST_IRQ macro value to the bigger IRQ ID;
  2. Create one file per IRQ: is that a host or UML file? I'm trying to follow random driver example but /dev/random exists in both;
  3. When I need to throw an IRQ I just have to write something on the file and send a SIGIO signal. Which process needs to receive the SIGIO?

In my system I'm using the original driver and using a userspace application to emulate the hardware (communication through netlink sockets). So, the emulator decides when IRQs needs to be launched and, at the moment, communicates that to the kernel driver.

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
Balaco Baco | 12 Nov 01:15 2015

Re: [uml-user] Website is in need of many small changes and updates?

On Sat, Oct 31, 2015, at 05:46, Richard Weinberger wrote:
> Am 31.10.2015 um 02:12 schrieb Balaco Baco:
> > I do not have a final working step by step from zero until now. One is
> > giving compiling errors. The working UML (unknown origin, I don't know
> > how I made that before) + Debian64 downloaded (and how changed a bit
> > after booting it)... but it has no network, and I don't know why is
> > that. Can you tell? Not even a ping works: "Network is unreachable". The
> > host machine is normal, of course.
> 
> As with any virtual machine you need to connect your VM somehow to your
> host.
> tap is a common way. The website has instructions. Old, but still valid.
> 

I just saw this unread message. And there is a few things to say about
this one. :)

Some old instructions in the website do not work. For example, the
kernel version used there was not practical for me. And you also said
it's too old - although I won't mind that fact alone.

> > Basic question: how to shutdown a running UML? How are we suppose to do
> > it? Running 'shutdown now' from that Debian does not turn it off. Must I
> > open another SSH session to kill it, or just close the session if
> > nothing else is needed?
> 
> What about "poweroff"? As with any Linux.
>

I have never heard about poweroff. In all the years I have used linux
(more than a decade) I always used shutdown to... to turn off the
computer (I would say "to shutdown"... but that would be too funny
here).

Debian has poweroff too. It worked. :-/ (but I swear I never used it...
and "shutdown now" always worked in real machines, to turn them off...)

> > I'm used http://user-mode-linux.sourceforge.net/source.html as a base to
> > what I have done (although I "updated" the suggested version there, as
> > discussed before). And changed almost nothing in the default config
> > before compiling...
> > 
> > When I have something that works, that source.html page is easy to
> > improve and needs many changes. Output of wget... not useful at all - we
> > surely can assume users will know how to download and extract files,
> > right?
> 
> I assume that an user is able to build a kernel.
> 

Fair enough. But I think that UML should be also aimed at users without
much knowledge in kernel compilation because sometimes we could just
want a virtual and easy, although safe, "root power". The reason why I'm
trying to get UML to work right now is one of these cases.

-- 
  Balaco

--

-- 
http://www.fastmail.com - Same, same, but different...

------------------------------------------------------------------------------
Balaco Baco | 11 Nov 17:13 2015

[uml-user] Detail with one config warning

There is one details that did not work for me, but it was easy to "fix"
(quotes because I'm not sure it is the best fix). But someone else may
find it useful.

Detailed steps so everyone can compare doing it, if needed:

>  1. get one kernel source package from https://cdn.kernel.org/
>  (I tried these steps with more than one option, searching for the older and more stable
>  version; if the results are different for you, try another one; below I copied my 4.2.6 try; 3.18 does not
have this problem)

>  2. extract it.
$ tar xJf ...
$ cd lin<TAB>

>  3. first step...
$ make defconfig ARCH=um #uml1

*** Default configuration is based on 'x86_64_defconfig'
kernel/time/Kconfig:157:warning: range is invalid
#
# configuration written to .config
#

> That warning is strange. I did not like it. So I just edited that file, and changed it! :D hehehe

$ vim kernel/time/Kconfig  # if it spitted a diff for line 157:
-        range 1 NR_CPUS
+       range 1 1

> So, again...
# make defconfig ARCH=um #uml1
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#

> So, assume the next steps have no problem, except that I don't know
> how to make my UML access the Internet... this is in another
> discussion, though

> ... ?
$ make menuconfig ARCH=um #uml2

> Build it
$ make ARCH=um #uml3 uml4 uml5

> Run it now... but where is my Internet? :( hehehehe

$ ./vmlinux # the output name changed!? :P

-- 
  Balaco

--

-- 
http://www.fastmail.com - Access your email from home and the web

------------------------------------------------------------------------------
Balaco Baco | 30 Oct 17:02 2015

[uml-user] Building from source problems and possibilities

I restarted, now I've got another kernel source (2.6.32.68), knowing
that it may be old, but it's the "newer old" for 2.6, and I hoped that
it would work.

Steps done:

1. downloaded https://cdn. kernel
.org/pub/linux/kernel/v2.6/longterm/v2.6.32/linux-2.6.32.68.tar.xz
2. extract with tar cJf (whatever)
3. A few commands:
    make defconfig ARCH=um          
    # config is saved on a file, to be restarted from a known point
    whenever needed
    make menuconfig ARCH=um
    make mrproper                    # zero start guarantee when
    repeating these steps
    make mrproper ARCH=um   #  "
    make ARCH=uml                   

4. It stops a few seconds after, with a few errors that may be simple to
fix:

===============
arch/um/os-Linux/start_up.c: In function 'check_coredump_limit':
arch/um/os-Linux/start_up.c:340:16: error: storage size of 'lim' isn't
known
  struct rlimit lim;
                ^
arch/um/os-Linux/start_up.c:341:2: error: implicit declaration of
function 'getrlimit' [-Werror=implicit-function-declaration]
  int err = getrlimit(RLIMIT_CORE, &lim);
  ^
arch/um/os-Linux/start_up.c:341:22: error: 'RLIMIT_CORE' undeclared
(first use in this function)
  int err = getrlimit(RLIMIT_CORE, &lim);
                      ^
arch/um/os-Linux/start_up.c:341:22: note: each undeclared identifier is
reported only once for each function it appears in
arch/um/os-Linux/start_up.c:349:22: error: 'RLIM_INFINITY' undeclared
(first use in this function)
  if (lim.rlim_cur == RLIM_INFINITY)
                      ^
arch/um/os-Linux/start_up.c:340:16: warning: unused variable 'lim'
[-Wunused-variable]
  struct rlimit lim;
                ^
cc1: some warnings being treated as errors
make[1]: *** [arch/um/os-Linux/start_up.o] Error 1
make: *** [arch/um/os-Linux] Error 2

===============

Do you know the reason for these two errors? And how I should fix them?

-- 
  Balaco

--

-- 
http://www.fastmail.com - Does exactly what it says on the tin

------------------------------------------------------------------------------
Richard Weinberger | 29 Oct 14:18 2015
Picon

Re: [uml-user] Possible ways to execute

Am 29.10.2015 um 14:14 schrieb Balaco Baco:
> Really!? I wish I had read that somewhere. Well, just retried with
> another option that is there for me. It is one of the cases I detailed
> before that end with error.
> 
> The full execution, right now, is:
> 
> ==========================
> $./linux-2.6.24-x86_64 ubda=Debian-Wheezy-AMD64-root_fs mem=128M

Linux 2.6.24?! SRSLY?

Thanks,
//richard

------------------------------------------------------------------------------
Balaco Baco | 29 Oct 12:28 2015

[uml-user] Possible ways to execute

A few weeks ago, after more struggling than I expected, I was abble to
run UML. I recompiled the linux kernel from source; I did not use the
root fs files available in the website, and found a Debian that seems to
suit my needs.

But yesterday I tried to execute it again, it did not work. The fact
that yesterday I tried it through SSH makes a difference?

Most of the command lines I had in my Bash history (long enough to have
almost everything I did in the previous session with this problem). None
of them worked. Most of them just seg fault in the beginning of
execution. Error related to root fs (surprise for me!). Just two of the
commands I tried did not seg fault immediatelly; but they also give no
output, and I had to start another SSH session, at the same time, to be
able to kill it (since ctrl+c and any other keyboard shortcuts) would be
"processed" my uml. I'm not sure what to do now.

This command line I executed right now:

./linux-2.6.24-x86_64 ubda=Debian-Wheezy-x86-root_fs  mem=128M 

Execute in the folder where the root fs file exists, gives ONLY this
output (almost immediatelly). It is through SSH. Is there a problem
here? I expected an user/password "screen" or anything similar.

The whole output I have for the above command, and I will let it waiting
for several minutes, is:

===========================================
Core dump limits :
	soft - 0
	hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...OK
Checking advanced syscall emulation patch for ptrace...OK
Checking for tmpfs mount on /dev/shm...nothing mounted on /dev/shm
Checking PROT_EXEC mmap in /tmp/...OK
Checking for new_mm and switch_mm support in the host:
	/proc/self/mm ... Failed - 
No such file or directory
Checking for the skas3 patch in the host:
  - /proc/mm...not found: No such file or directory
  - PTRACE_FAULTINFO...not found
  - PTRACE_LDT...not found
UML running in SKAS0 mode
Adding 29876224 bytes to physical memory to account for exec-shield gap
Linux version 2.6.24-g91525300-dirty (jdike <at> amd64.user-mode-linux.org)
(gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)) #1 Mon Jan 28 12:03:41
EST 2008
Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
39515
Kernel command line: ubda=Debian-Wheezy-x86-root_fs mem=128M root=98:0
PID hash table entries: 1024 (order: 10, 8192 bytes)
Dentry cache hash table entries: 32768 (order: 6, 262144 bytes)
Inode-cache hash table entries: 16384 (order: 5, 131072 bytes)
Memory: 122164k available
Mount-cache hash table entries: 256
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
net_namespace: 120 bytes
Using 2.6 host AIO
NET: Registered protocol family 16
NET: Registered protocol family 2
Time: itimer clocksource has been installed.
IP route cache hash table entries: 2048 (order: 2, 16384 bytes)
TCP established hash table entries: 8192 (order: 5, 131072 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
Checking host MADV_REMOVE support...OK
mconsole (version 2) initialized on
/home/folder/path/.uml/1DZd7v/mconsole
((! the above line was manually changed for this message; and the
working folder is a subfolder in my home folder !))
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Initialized stdio console driver
Console initialized on /dev/tty0
console [tty0] enabled
Initializing software serial port version 1
console [mc-1] enabled
 ubda: unknown partition table
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
request_module: runaway loop modprobe binfmt-464c
request_module: runaway loop modprobe binfmt-464c
request_module: runaway loop modprobe binfmt-464c
request_module: runaway loop modprobe binfmt-464c
request_module: runaway loop modprobe binfmt-464c

===========================================

What do you suggest to try?

-- 
  Balaco

--

-- 
http://www.fastmail.com - A fast, anti-spam email service.

------------------------------------------------------------------------------
Ricardo Nunes | 28 Oct 17:36 2015
Picon
Gravatar

[uml-user] Any reason for a kernel thread not run after calling schedule()?

Hi,

I'm making a UML driver to adapt a real driver to UML and hardware emulation.

In this case I have a kernel thread trying to read a register, which is now done through a netlink channel to a userspace application (asynchronous response) but inside a synchronous function (the function that I'm implementing returns the register value). The first attempt was done doing:

Kernel thread
sleeping_task = current; set_current_state(TASK_INTERRUPTIBLE); schedule();

Netlink new message callback

wake_up_process(sleeping_task);

But the kernel thread never runs again, unless I call schedule() in netlink callback function after wake_up_process, which will make that callback being blocked. I also tried using wait_queue but after the same result I saw the functions and realised that they also use schedule for putting the process to sleep.

This worked in a "real" linux module (not with netlink callback, but between 2 kernel threads), I don't understand why shouldn't in UML. Any reason you might remember?

I'm using 4.2.1 Kernel with a Debian Jessie distro.







------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
Ricardo Nunes | 22 Oct 13:29 2015
Picon
Gravatar

[uml-user] IRQ support?

I'm trying to use a real hardware driver inside UML and I,ve come to the IRQ suppor part.

Right now it's failing on request_irq call, so my question is if there is any manual on how to support this method calls in UML or if it's supposed to work as it is.

I need to register IRQs and raise them. After a few searches I saw SIGIO module and everything, but it didn't help enough.

What's the best way to support this?

Thanks
------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
Ricardo Nunes | 12 Oct 16:46 2015
Picon
Gravatar

[uml-user] UML <-> host communication

Hi. I'm trying to create a 2 way communication channel between a kernel driver in UML with a process at the host.

What's the best way to do it? I started by trying to create a pipe ath the host, share in hostfs but I can't get any communication (write on pipe in UML, nothing appears in host).

Plus, I'm using os_open_file kind of functions (shared/os.h) but it always return me error -2 (bad file path). I thought that it could be because the kernel module was loaded before the hostfs is mounted but the same error happens if I insmod it after boot.

What are the alternatives here? I wanted a low latency type of communication, minimum overhead since it will be a lot of communications os 5-10 bytes each time.

Thanks
------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
Ricardo Nunes | 9 Oct 17:11 2015
Picon
Gravatar

[uml-user] Creating Wheezy filesystem from scratch

I'm trying to create a Debian Wheezy filesystem to use in User Mode Linux. right now I'm following this tutorial. The commands after # Remove the other terminal events don't work here and I can't find the equivalent operations in Wheezy.

When I try to boot all of the system gets frozen and ends up with this (full log here):

INIT: Entering runlevel: 2 [[36minfo[39;49m] Using makefile-style concurrent boot in runlevel 2. [ 12.690000] Virtual console 5 assigned device '/dev/pts/12' [ 12.690000] Virtual console 6 assigned device '/dev/pts/19' [ 12.690000] Virtual console 4 assigned device '/dev/pts/20' [ 12.690000] Virtual console 3 assigned device '/dev/pts/26' [ 12.690000] Virtual console 2 assigned device '/dev/pts/27' [ 12.690000] Virtual console 1 assigned device '/dev/pts/28'

I would use a already prepared filesystem, or even rootstrap, but both of them forces me to have internet inside the UML machine and, for security reasons in this environment, I cannot create bridges to my own network.

Do you know how can I pass this until I get a login message?

Thanks

------------------------------------------------------------------------------
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Gmane