Hi,

On Friday 07 July 2006 10:29, Tim Dijkstra wrote:
> I'm trying to integrate another splash system into suspend. 

Great. :-)

> It's a userspace splash program (splashy) so it should be easier for people 
> to use (no kernel patches), but 'm not really sure if it's going to work at 
> all. 
> 
> Being a userspace program, is it going to be frozen? I guess it will from 
> the point we call freeze(), right?

Yes.

> So for it to be allowed to draw on the screen till the end of the process, 
> we'll have to do the drawing ourselves?

Yes.

> Do children also get frozen? 

Yes.  Only the current task is not frozen.
 
> I also have some questions about the code related to that.
> 
> First:
> 
> What is this switch_vt_mode macro used in suspend_system supposed to do?

This is a hack to prevent users from switching back to X while processes
are being frozen.
 
> Whatever it is, I don't think it's doing the right thing now. My 
> console_ioctls 
> man page says if you want to set you KD_GRAPHICS or KD_TEXT you need the 
> KDSETMODE ioctl, not KDSKBMOD.

Yes, this looks like a bug. ;-)

It's supposed to switch the keyboard K_MEDIUMRAW, switch the mode,
freeze processes, switch the mode back to text and switch the keybard
to K_XLATE.

> #define switch_vt_mode(fd, vt, ioc1, ioc2)      ioctl(fd, KDSKBMODE, ioc1); \
>                                                 ioctl(fd, VT_ACTIVATE, vt); \
>                                                 ioctl(fd, VT_WAITACTIVE, vt); 
> \
>                                                 ioctl(fd, KDSKBMODE, ioc2);
>                                                                               
>   
> int suspend_system(int snapshot_fd, int resume_fd, int vt_fd, int vt_no)
> {
>         loff_t avail_swap;
>         unsigned long image_size;
>         int attempts, in_suspend, error = 0;
>                                                                               
>   
>         avail_swap = check_free_swap(snapshot_fd);
>         if (avail_swap > pref_image_size)
>                 image_size = pref_image_size;
>         else
>                 image_size = avail_swap;
>         if (!image_size) {
>                 fprintf(stderr, "suspend: No swap space for suspend\n");
>                 return ENOSPC;
>         }
>                                                                               
>   
>         switch_vt_mode(vt_fd, vt_no, K_MEDIUMRAW, KD_GRAPHICS);
>         error = freeze(snapshot_fd);
>         switch_vt_mode(vt_fd, vt_no, KD_TEXT, K_XLATE);
> 
>         splash.switch_to();
>         splash.progress(15);
> 
> 
> Is this KDSETMODE juggling also the reason to switch to splash only at this 
> point?

I think it's not the only reason, but Holger knows the details (so he's CCed 
now).

> Another question:
> 
> Is there any particular reason to splash_prepare() before console_prepare() ?
> I rather have it the other way around.

splash_prepare() here sets up the splash system and makes sure it _won't_ draw
anything while the console is being prepared.

IOW, we should call splash->to_silent() before prepare_console(), but for this
purpose the splash system has to be initialized.

Greetings,
Rafael

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to