On Fri 07. Jul - 13:04:15, Rafael J. Wysocki wrote:
> Hi,
> 
> On Friday 07 July 2006 10:29, Tim Dijkstra wrote:
[...]
> > #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).

The reason why splash.switch_to() is done after freeze() is because if we
are already at the splash console on freeze, and the splash is in silent
mode (the whole screen is covered), it switches to verbose mode. I wasn't
able to figure out the reason for that. But IIRC, the culprit for that is
freeze() and not the KDSETMODE things. If freeze() is done while we are at
another console, the silent mode stais intact IIRC.

> > 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.

With current CVS, splash_prepare() is actually called before
prepare_console() and it includes a call to splash->to_silent(). But maybe
I'm missing something here...


Regards,
        Holger

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