[help] Where can I turn on CURSES_CONSOLE under Palacios release 1.3?

76 views
Skip to first unread message

fredfsh

unread,
May 11, 2012, 12:58:59 PM5/11/12
to v3vee-de...@googlegroups.com
Hi there,

I'm new and please forgive me if I have posted in the wrong place.

I'm trying to build Palacios 1.3 into Linux. According to the manual v1.3, I've compiled and integrated the kernel module. I've set up the VM (of ubuntu server 12.04) and launched it (successfully, I think). However, there's not enough display information. I guess the VM is running well since dmesg shows nothing inappropriate until I invoke v3_cons. What I want is to use v3_cons to check things really goes well.

But dmesg shows something like "V3 IOCTL 20, unable to handle IOCTL 20" when running v3_cons. The manual v1.3 says I have to compile in CURSES_CONSOLE. Well, when running "make menuconfig", there is no place for me choose whether I can switch this option on. There is really an option to switch on TELNET_CONSOLE, but sadly no CURSES_CONSOLE. By the way, in release 1.2, the CURSES_CONSOLE was there, along with the TELNET_CONSOLE, under the compile option of CGA.

So my question is, where is the CURSES_CONSOLE option in menuconfig under release 1.3? Many thanks for your help.

Best wishes,

fredfsh

Peter Dinda

unread,
May 11, 2012, 1:09:26 PM5/11/12
to v3vee-de...@googlegroups.com
You will want to do the following, from "make menuconfig":

Target Configuration -> Host Interfaces -> Make sure "Host Support for
VM text -mode console" is enabled

Now, you will be able to see the following:

Virtual Devices -> CGA [turn on]
Virtual Devices -> CGA -> Curses Virtual Console [turn on]

Then you can use v3_cons or v3_cons_sc. They connect via the "Host
Support" and talk to the Curses Console, which is a backend for CGA.
Your guest will write to the console by writing to CGA.

Peter
> --
> You received this message because you are subscribed to the Google Groups
> "V3VEE Development" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/v3vee-development/-/14mIv1DjTxIJ.
> To post to this group, send email to v3vee-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> v3vee-developm...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/v3vee-development?hl=en.



--
Dr. Peter A. Dinda
Professor
Head, Computer Engineering and Systems Division
Department of Electrical Engineering and Computer Science
Northwestern University
2145 Sheridan Avenue
Evanston, IL 60208
847-467-7859 (voice)
http://www.eecs.northwestern.edu/~pdinda
pdi...@northwestern.edu

fredfsh

unread,
May 12, 2012, 12:11:46 AM5/12/12
to v3vee-de...@googlegroups.com
Hi Peter,

Thank you for your quick reply.

According to your instruction, I managed to move a step further but trapped in the same situation as Scott described in this post. CGA_VIDEO was unable to initialize when creating the VM. Here's the dmesg dump.

[  219.526176] configuring device CGA_VIDEO
[  219.526178] Allocating 32 pages (align=4096)
[  219.526179] Start idx 0 (base_addr=0000000038000000)
[  219.526322] palacios/src/devices/cga.c(1255): 
[  219.526322] 
[  219.526322] Video Hook failed.
[  219.526323] 
[  219.526324] palacios/src/palacios/vmm_dev_mgr.c(266): Could not initialize Device CGA_VIDEO

As Scott has said, it seems a call to v3_hook_write_mem in vmm_mem_hook.c failed, which may be further caused by a failed try of calling v3_insert_mem_region in vmm_mem.c.
I have no idea how to fix the problem. Thanks.

By the way, related part of my XML file for guest OS looks like

<device class="CGA_VIDEO" id="cga" passthrough="disable" />
<device class="CURSES_CONSOLE" id="console">
                       <frontend tag="cga" />
</device>

Best wishes,

fredfsh
> To post to this group, send email to v3vee-development@googlegroups.com.
> To unsubscribe from this group, send email to

Peter Dinda

unread,
May 12, 2012, 3:04:30 PM5/12/12
to v3vee-de...@googlegroups.com
You probably have a memmap region in your configuration (XML file) that maps a0000...  Remove that and the memory hook will work.  Another possibility is that you also have a VGA device on your XML - remove it if that's the case.

Peter
>> > To post to this group, send email to v3vee-de...@googlegroups.com.

>> > To unsubscribe from this group, send email to
>> > v3vee-developm...@googlegroups.com.

>> > For more options, visit this group at
>> > http://groups.google.com/group/v3vee-development?hl=en.
>>
>>
>>
>> --
>> Dr. Peter A. Dinda
>> Professor
>> Head, Computer Engineering and Systems Division
>> Department of Electrical Engineering and Computer Science
>> Northwestern University
>> 2145 Sheridan Avenue
>> Evanston, IL 60208
>> 847-467-7859 (voice)
>> http://www.eecs.northwestern.edu/~pdinda
>> pdi...@northwestern.edu
>
> --
> You received this message because you are subscribed to the Google Groups "V3VEE Development" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/v3vee-development/-/nm4vn9r8r-4J.
> To post to this group, send email to v3vee-de...@googlegroups.com.
> To unsubscribe from this group, send email to v3vee-developm...@googlegroups.com.

Shi FENG

unread,
May 13, 2012, 1:14:37 AM5/13/12
to v3vee-de...@googlegroups.com
Hi Peter,

After commenting out the stuffs related to VGA according to your instruction, the console module is configured successfullly when creating the VM. Something related to GENERIC device went wrong. dmesg shows "generic (generic): can't hook port 0x3b4 (already hooked?)". As I had borrowed and adapted the XML config file from default.xml, I merely commented out the part (marking in red as follows, note it's related to graphic card) to smooth the setup process.

Then I launched the VM with delight and used v3_cons to monitor the bootup process. While the terminal displays,

graphics initialization failed
Error setting up gfxboot
boot: 

And the prompt "boot:" started to repeat endlessly. After googling for a while, I came to the conclusion that the problem is most common when booting up Ubuntu, rather than other Linux distribution, and is related to the underlying hardware (graphic card) on which the guest OS (Ubuntu Server) is booting. I'm not sure if it has something to do with the action that I commented out the graphic-cards-related stuffs in the config file. I am also trying to boot up a lightweight guest OS instead of Ubuntu to bypass the error. Or maybe there is some workaround to preserve the stufff related to graphic cards in the XML config file?

I have received enough support and valuable help from you and thank you very much for your time. It'll be great if you have any suggestion on this Ubuntu specific problem. Or do you experience the similar situation when deploying on Ubuntu? Thank you.

Best wishes,

fredfsh

Appendix: part of the XML config file
<device class="GENERIC" id="generic">
<ports>
                               <start>0x00</start>
                               <end>0x07</end>
                               <mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<start>0xc0</start>
<end>0xc7</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- DMA 1 page registers -->
<start>0x81</start>
<end>0x87</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- DMA 2 page registers -->
<start>0x88</start>
<end>0x8f</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- DMA 1 Misc Registers -->
<start>0x08</start>
<end>0x0f</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- DMA 2 Misc Registers -->
<start>0xd0</start>
<end>0xde</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- Serial COM 1 -->
<start>0x3f8</start>
<end>0x3ff</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- Serial COM 2 -->
<start>0x2f8</start>
<end>0x2ff</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- Serial COM 3 -->
<start>0x3e8</start>
<end>0x3ef</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- Serial COM 4 -->
<start>0x2e8</start>
<end>0x2ef</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- Parallel Port -->
<start>0x378</start>
<end>0x37f</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
                        <!--
<ports>
                        -->
<!-- Graphics Card modeerations -->
                        <!--
<start>0x3b0</start>
<end>0x3bb</end>
<mode>PRINT_AND_PASSTHROUGH</mode>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
                        -->
<!-- Graphics Card modeerations -->
                        <!--
<start>0x3c0</start>
<end>0x3df</end>
<mode>PRINT_AND_PASSTHROUGH</mode>
<mode>PRINT_AND_IGNORE</mode>
</ports>
                        -->
<ports>
<!-- ISA PNP -->
<start>0x274</start>
<end>0x277</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- ISA PNP -->
<start>0x279</start>
<end>0x279</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
<ports>
<!-- ISA PNP -->
<start>0xa79</start>
<end>0xa79</end>
<mode>PRINT_AND_IGNORE</mode>
</ports>
               </device>
       </devices>


</vm>

==========
Shi FENG (冯时)

PACMAN Group
Institute of High Performance Computing
Department of Computer Science and Technology
Tsinghua University
Haidian District, Beijing, China

Peter Dinda

unread,
May 13, 2012, 9:43:27 AM5/13/12
to v3vee-de...@googlegroups.com, project .
GENERIC not being able to hook ports should not be a problem - it's
expected that it won't be able to hook ports that are used elsewhere.
0x3b4, etc, will be hooked by the video card before GENERIC comes up.

If you're trying to boot Ubuntu as a guest, be aware that even with
CGA, there is no graphics support. You could try VGA, but you would
want to do that using the devel branch, not 1.3.

Chang: can you make sure he has a 1.3 guest that works, say something
from palacios-staging?

Peter

Shi FENG

unread,
May 13, 2012, 11:15:02 PM5/13/12
to v3vee-de...@googlegroups.com, project .
Thanks, Peter. Your explanation helps me understand the problem a little bit further. I have posted in the Ubuntu forum to see if it is bootable under current configurations.

==========
Shi FENG (冯时)

PACMAN Group
Institute of High Performance Computing
Department of Computer Science and Technology
Tsinghua University
Haidian District, Beijing, China



Peter Dinda

unread,
May 14, 2012, 11:27:23 AM5/14/12
to v3vee-de...@googlegroups.com, project .
Some common kernel options to try include debug, console=ttyS0 [put
console on serial port] and vga=xxx. Basically, even if you are
booting a "text mode" kernel, if it recognizes a vga card, it may try
to use an enhanced text mode that is incompatible with CGA console.
If you turn on telemetry in Palacios and you continue to see output
with increasing counts over time, then your guest is probably up and
running, but is using the screen in a way that CGA cannot handle.

Peter

Shi FENG

unread,
May 16, 2012, 5:21:27 AM5/16/12
to v3vee-de...@googlegroups.com, project .
I tried some other guest OSes.

1. The simple guest os provided by Palacios
This BIOS was able to boot from CD-ROM but it stuck after booting to 0x7C00.
Inline image 1
As I have no access to the xml config file of this guest image, I have no idea whether it is related to the graphics support. At least dmesg shows nothing inappropriate.

It's similar as the case when booting Ubuntu. The OS was able to boot but fell into endless "boot:" prompt.Inline image 1
It is mentioned that a kernel may try to boot in an enhanced text mode if it recognizes a vga card. Why does this happen if there is no stuff of virtual VGA configuration in my Guest VM config file? Thanks.

==========
Shi FENG (冯时)

PACMAN Group
Institute of High Performance Computing
Department of Computer Science and Technology
Tsinghua University
Haidian District, Beijing, China



dos.png
simpleguest.png

Peter Dinda

unread,
May 16, 2012, 2:44:16 PM5/16/12
to v3vee-de...@googlegroups.com, project .
If the simple guest os fails for you on the release 1.3 or devel branch, that's definitely our bug.   That image does not do anything complicated with the video hardware.   Some more comments below.  


On Wed, May 16, 2012 at 4:21 AM, Shi FENG <fre...@gmail.com> wrote:
I tried some other guest OSes.

1. The simple guest os provided by Palacios
This BIOS was able to boot from CD-ROM but it stuck after booting to 0x7C00.
Inline image 1
As I have no access to the xml config file of this guest image, I have no idea whether it is related to the graphics support. At least dmesg shows nothing inappropriate.


This problem with our guest_os.img is not related to the graphics support.  The guest os image does not do anything complicated with the video card.

One dumb question:  how many rows and columns does your terminal have?  The window needs to be at least 80x25 in order for the console to work correctly.    If the window is a smaller size, some of the output will be clipped, and scrolling may be wrong.

If that's not the issue, then could you post a copy of the dmesg output (preferably with telemetry turned on), and also print out /proc/cpuinfo   





 

It's similar as the case when booting Ubuntu. The OS was able to boot but fell into endless "boot:" prompt.Inline image 1
It is mentioned that a kernel may try to boot in an enhanced text mode if it recognizes a vga card. Why does this happen if

Very strange.  That guest should also work without any issues.   
 
there is no stuff of virtual VGA configuration in my Guest VM config file? Thanks.


The issue is that the CGA device + the bios can confuse the guest into thinking that a VGA exists.  This is a problem in Palacios, not in your setup.   
simpleguest.png
dos.png

Shi FENG

unread,
May 17, 2012, 5:00:07 AM5/17/12
to v3vee-de...@googlegroups.com, project .
I suppose it's not bugs in Palacios if it has been well tested on many platforms. I experienced some difficulties compiling the kernel module and especially when compiling the user utilities. Although I managed to bypass all the compiling errors and got them run up finally under your help, I still suspect I may have done some configuration improperly.
For example, in the guest OS boot screen, when I hit the some keys, the echo character on the console doesn't seem properly. "ESC" goes "]" and "Enter" -> "9"... Not a keystroke is right.

So is there any possibility that the problem is rooted in the user tool v3_cons which I didn't compile properly?
Recompiling the user utils, I experience many "undefined references" errors. Sorry I didn't remember how I had managed to work around these errors. For example, the command to compile v3_cons is:
gcc -static v3_cons.c -o v3_cons -lcurses
It results in undefined reference error to a function called raw().
If I remove the -static option, it compile. readelf -s libcurses.a shows that raw() occurs in a file called lib_restart.o but the type is UND. So should I link it? But where is it and how? And does it matter if I remove the option -static?
I downloaded the curses packages through official package manager so there may be no problems with the lib itself. Well, it is said compiling with curses on Ubuntu often results in troubles.

==========
Shi FENG (冯时)

PACMAN Group
Institute of High Performance Computing
Department of Computer Science and Technology
Tsinghua University
Haidian District, Beijing, China



dos.png
simpleguest.png
cpuinfo
dmesg.dump

Peter Dinda

unread,
May 17, 2012, 11:12:13 AM5/17/12
to v3vee-de...@googlegroups.com, project .
Here is how I interpret your cpuinfo and dmesg output:

- you have an Intel processor with a version of VMX that supports both the EPT and Unrestricted Guest options.   Palacios should be able to run on this without difficulty.  For the record, this is a 

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz
stepping : 7
microcode : 0x17

- Palacios's initialization of VMX support on the processor seems to be fine. 

- memory offlineing (v3_mem) seems to be working fine

- guest bootstrap (bios, vga bios) seems OK.  You get telemetry, although it's clear it's still in real mode.   

- This all seems to suggest that the VM is active, and is sitting at that ISOLINUX boot prompt.  [that text won't show up in the dmesg output].   

I understand that you are using v3_cons to try to connect to the console.  And from seeing your images, you are running v3_cons in a terminal window.   You try to type things, but you get the wrong output.   If this is the case, then I know exactly what the problem is:  v3_cons *will not work* in a terminal window.  It will *only* work when run from PC's console itself.  For example, you can use CTRL-ALT-F* to switch to a text console on your PC, and then run it from there.   If you want to do a console in a terminal window, or ever an ssh connection, or anything other than a PC console, you need to do this:

1. Make sure your window is at least 80x25  (>=80 characters by >=25 lines)

2. Use v3_cons_sc:

v3_cons_sc /dev/v3-vm0 2>/dev/null

If you look for v3_cons and v3_cons_sc in the tech report, you'll see an explanation of why there is this difference.

You can compile all the linux_usr tools with or without -static.  The -static is there by default so that there is no shared library dependency.   It sounds like in your setup, there is no raw() function in the static library, but there is one in the dynamic library.  raw() is used by v3_cons (but not v3_cons_sc) so that it can get access to the raw pc keyboard (which only works on a PC console).  

Try (1)+(2) above, and I bet you'll be able to get guest_os.img to get a lot further.

Peter
simpleguest.png
dos.png

Shi FENG

unread,
May 17, 2012, 11:34:35 PM5/17/12
to v3vee-de...@googlegroups.com, project .
Good news! Your magical prediction came true. Using v3_cons_sc and I managed to boot the guest_os, eventually. As you have mentioned, everything went well indeed and the VM was just waiting for me to hit "Enter" on the boot prompt, which couldn't be done using v3_cons in a virtual terminal. The manual was written clearly enough to explain the difference between v3_cons and v3_cons_sc, which I neglected for the first time reading it. As the terminal mode seems broken on my machine (due to N-card drivers, I cannot enter it using Ctrl+Alt+Fx nor through modifying the grub config file) I don't check v3_cons but I believe it'll be fine. Yet few keystrokes (e.g. "Backspace") don't work. Anyway, those defects don't hurt.

Booting freedos1.1 failed. The screen flashes with "stripe" of characters.
Inline image 2
Booting ubuntu-server results in similar displays, this time, using v3_cons_sc to peek. With the previous analysis, maybe the error with freedos is also related to the enhanced text mode?

Thank you again for helping me set up the whole thing. The next goal is to port a lightweight OS μcore to run as a Palacios guest. 



Best wishes,

fredfsh

==========
Shi FENG (冯时)

PACMAN Group
Institute of High Performance Computing
Department of Computer Science and Technology
Tsinghua University
Haidian District, Beijing, China



dos.png
dos.png
simpleguest.png

Peter Dinda

unread,
May 18, 2012, 1:30:57 PM5/18/12
to v3vee-de...@googlegroups.com, project .
Good to hear that.

Those "cursor set" messages are debugging output from v3_cons_sc.   If you run it like this:

v3_cons_sc /dev/v3-vm0 2>/dev/null

(note the 2>/dev/null). you will see a clearer display.   There are keys that v3_cons_sc does not translate because a unix terminal is no the same as a PC keyboard.

Generally, before you give up on a guest, check the dmesg output.  If you hit a hard error, it will be obvious. If you continue to get telemetry, it is likely it is running fine but you're seeing an interface issue.

Regarding freedos:  DOS is real-mode, which we have limited support, especially on Intel.  If you really need it, make sure you get the latest from the devel branch and you make sure that Palacios is using the "Unrestricted Guest" feature in running your VM.

Peter
dos.png
dos.png
simpleguest.png

Shi FENG

unread,
May 18, 2012, 9:33:01 PM5/18/12
to v3vee-de...@googlegroups.com, project .
Thank you for your advice. Redirecting stderr makes it clear for both guest_os.img and guest_os_mc.img.
freedos behaves just like what I have posted the screenshot. Within dmesg I can see continuous telemetry info and everything seems fine. Yet I just test it for fun so it doesn't really matter.

==========
Shi FENG (冯时)

PACMAN Group
Institute of High Performance Computing
Department of Computer Science and Technology
Tsinghua University
Haidian District, Beijing, China



simpleguest.png
dos.png
dos.png
Reply all
Reply to author
Forward
0 new messages