ArticlePDF Available

Linux screensaver for Windows

Authors:

Abstract

Construct and package a Linux® LiveCD so that it will install using the standard Microsoft® Windows® install process and will operate as a standard Windows screensaver. Answering the most common concern about open source software, this article shows that, yes, Linux will run under Windows. So why should you read this article? Why, indeed, should I write it? My motive is to help remove two obstacles to the wider adoption of free and open source software. Those obstacles are: The perceived difficulty and disruptive effects of installing Linux The uncertainty of hardware support for Linux Most computer users are familiar with a Microsoft Windows environment and with the variety of screensavers available to prevent unauthorized access to the data on the computer when unattended. There is sufficient free and open source software available nowadays to enable Linux to install and run as a Windows screensaver. This article shows you how to construct an appropriate CD or DVD, and in doing so, demonstrates that the "free" and "non-free" sides of the software Grand Canyon are not so far apart after all. The examples in this article correspond to three current IBM objectives: Concluding the OS/2 business Reinventing education Encouraging people to learn science. This article is currently up on Developerworks Japan here http://www.ibm.com/developerworks/jp/linux/library/l-scrnsave/
Linux screensaver for Windows
LiveCDs demonstrate that, yes, Linux can run under Windows
Level: Introductory
Chris Ward
(
tjcw@uk.ibm.com
), Advisory Software Engineer, IBM
20 Dec 2005
process and will operate as a standard Windows screensaver. Answering the most common concern about open source
software, this article shows that, yes, Linux will run under Windows.
So why should you read this article? Why, indeed, should I write it? My motive is to help remove two obstacles to the wider adoption
of free and open source software. Those obstacles are:
The perceived difficulty and disruptive effects of installing Linux
The uncertainty of hardware support for Linux
Most computer users are familiar with a Microsoft Windows environment and with the variety of screensavers available to prevent
unauthorized access to the data on the computer when unattended.
There is sufficient free and open source software available nowadays to enable Linux to install and run as a Windows screensaver.
This article shows you how to construct an appropriate CD or DVD, and in doing so, demonstrates that the "free" and "non-free"
sides of the software Grand Canyon are not so far apart after all.
The examples in this article correspond to three current IBM objectives:
Concluding the OS/2 business
Reinventing education
Encouraging people to learn science
Successor to OS/2
OS/2 is finally being withdrawn on December 23, 2005. According to the IBM Web site on OS/2 Warp migration (see
Resources
),
there is no replacement product from IBM. IBM suggests that OS/2 customers consider Linux.
But which Linux? Without knowing what a client intends to do, it would be irresponsible to make a blanket recommendation.
However, on December 25, 2005, the demand for GamesKnoppix St. Nicholas' Day will be large, and the delivery capability will be
sufficient. And if you configure it as a screensaver, even the possibility of pressing the wrong key to start it is eliminated.
Figure 1. GamesKnoppix St. Nicholas' Day
The base ISO is GamesKnoppix 3.7-0.1 (see
Resources
).
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
1 of 7 05/11/2015 07:45 AM
Reinventing education
Reinventing education is a central focus for IBM's philanthropic efforts -- but even IBM is limited in what it can give. Organizations
chartered with this task -- such as the United Nations Educational, Scientific, and Cultural Organization (UNESCO) -- use all their
resources to that end. UNESCO has co-branded with the Organization for Free Software in Education and Teaching, a group of
concerned French parents, resulting in a "UNESCO Linux" (look for the Freeduc-CD). The license model for it is clear -- they accept
donations and they give it away for free.
Again, configuring the UNESCO Linux as a Windows screensaver eliminates fear, uncertainty, and doubt.
Figure 2. UNESCO Linux/Freeduc-CD
The base ISO is freeduc-cd 1.4.1 (see
Resources
).
Enabling science
Enabling scientific research and progress is another pillar of IBM's philanthropic efforts -- without this particular effort, there might
be no future IBMers (or future clients). But Big Blue cannot be everywhere. That's why there is Knosciences.
This Linux screensaver is from Nathalie Carrie and Arnaud Verhille, science teachers on Reunion Island, a French colony in the
Indian Ocean. This screensaver comes equipped with 700MB of applications to help school children learn their math and physics.
Verhille asks "Does anyone know where I can get a free Java," because he is concerned about encumbering his pupils with Sun®'s
license conditions.
Figure 3. Knosciences
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
2 of 7 05/11/2015 07:45 AM
I use Knosciences 0.95 in this article (see
Resources
).
Making it work: Nuts, bolts, and screws
Getting the ISO to run under another operating system requires an open source PC emulator, which includes an open source BIOS
and an open source virtual graphics adapter (such as QEMU version 0.7.2). The emulator enables you to set up a virtual PC within a
real one. To construct a screensaver, the best way is to configure it with a virtual CD-ROM drive, keyboard, screen, and mouse, but
without any virtual disks or network adapter.
Remember, running in emulation is slow (or "slooooooooowwww," like running interpreted Java code). But since we're doing this
under the auspices of a screensaver, modern PC hardware is sufficiently fast for the task.
Here are the steps to make this work.
Rebuilding QEMU
You need to rebuild QEMU -- I learned how by following instructions in a QEMU forum (see
Resources
). Get these packages:
The Minimalist GNU for Windows components:
MinGW
. This collection of freely available and freely distributable Windows-specific header files and import libraries
combined with GNU toolsets allows you to produce native Windows programs that do not rely on any third-party C
runtime DLLs.
MSYS
, a
Minimal SYStem
. This allows POSIX/Bourne configuration scripts to execute and create a makefile used by
make
.
msysDTK
. These add-ons for MSYS include telnet and rlogin.
SDL
, Simple DirectMedia Layer. This cross-platform multimedia library is designed to provide low-level access to audio,
keyboard, mouse, joystick, and 3D hardware via OpenGL and 2D video framebuffer.
zlib
. This lossless data-compression library can be used on virtually any computer hardware and operating system, required by
SDL.
directx
. This is required when SDL runs under Windows.
Inno Setup
. This is a free installer for Windows programs.
Inno Setup can help you package things in a way that is familiar to Windows users. I used version 5.1.5.
For a program to run as a Windows screensaver, it needs a name like "Knosciences.scr" and it needs to be in directory
C:\WINDOWS\SYSTEM32\. It will start from the command line with a command like
Knosciences.scr /s
and its "current
directory" will be C:\WINDOWS\SYSTEM32\.
With the following alterations to file vl.c in QEMU, it responds appropriately to the
/s
switch and runs in full-screen mode. This
implementation removes the virtual network card; if you take out the line specifying the
net_if_type
, you will have a
screensaver that treats Windows as a NAT-router-firewall.
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
3 of 7 05/11/2015 07:45 AM
Listing 1. Modifications to QEMU to enable it to run as screensaver
for(;;) {
if (optind >= argc)
break;
r = argv[optind];
if (r[0] != '-') {
if ( 0 == strcmp(r,"/s") ) {
/* Going to run as a Windows screen saver */
full_screen = 1 ;
bios_dir = "." ;
ram_size=512*1024*1024 ;
boot_device='d' ;
hd_filename[cdrom_index] = "knosciences-0.95.iso" ;
rtc_utc = 0;
net_if_type = NET_IF_DUMMY;
optind += 1 ;
} else {
hd_filename[0] = argv[optind++];
}
} else {
...
}
if ( full_screen == 1 )
{
putenv("SDL_VIDEODRIVER=windib") ;
}
After building QEMU, rename the i386-softmmu version of the qemu.exe file to Knosciences.scr.
Inno Setup
The following script for Inno Setup puts the screensaver and the ISO file into the C:\WINDOWS\SYSTEM32\ directory:
Listing 2. Script for the installer
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
;
[Setup]
AppName=Knosciences Screen Saver
AppVerName=Knosciences Screen Saver
AppPublisher=OFSET
AppPublisherURL=http://www.ofset.org/
AppSupportURL=http://www.ofset.org/
AppUpdatesURL=http://www.ofset.org/
DefaultDirName={pf}\Knosciences
DefaultGroupName=Knosciences
Compression=lzma
SolidCompression=yes
[Files]
Source: "{src}\qemusaver\Knosciences.scr"; DestDir: "{sys}"; Flags: external
Source: "{src}\qemusaver\knosciences-0.95.iso"; DestDir: "{sys}"; Flags: external
Source: "{src}\qemu\SDL.dll"; DestDir: "{sys}"; Flags: external
Source: "{src}\qemu\bios.bin"; DestDir: "{sys}"; Flags: external
Source: "{src}\qemu\vgabios.bin"; DestDir: "{sys}"; Flags: external
Source: "{src}\qemu\vgabios-cirrus.bin"; DestDir: "{sys}"; Flags: external
Source: "{src}\qemu\qemu-doc.html"; DestDir: "{app}"; Flags: external
Source: "{src}\qemu\vl.c"; DestDir: "{app}"; Flags: external
Source: "{src}\qemu\LICENSE\LICENSE"; DestDir: "{app}\LICENSE\LICENSE";
Flags: external
Source: "{src}\qemu\LICENSE\README-SDL.txt"; DestDir: "{app}\LICENSE\README-SDL.txt";
Flags: external
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Knosciences Screen Saver"; Filename: "{sys}\Knosciences.scr"
Name: "{group}\{cm:UninstallProgram,Knosciences Screen Saver}"; Filename: "{uninstallexe}"
File structure for the CD
The following file structure is needed for the CD:
autorun
starts the screen saver installer, the "live" Knosciences, and the documentation viewer.
Files in /qemu are related to the "live" Knosciences.
The SetupQemuSaver.exe file is the screensaver installer generated by Inno Setup.
Files in /qemusaver are the screensaver and the original ISO.
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
4 of 7 05/11/2015 07:45 AM
Files in /Knosciences are documentation from the original CD.
Listing 3. Bill-of-materials for the resulting CD
.
./autorun.bat
./autorun.inf
./autorun.pif
./qemu
./qemu/bios.bin
./qemu/linux_boot.bin
./qemu/qemu-doc.html
./qemu/qemu.exe
./qemu/qemu-img.exe
./qemu/qemu-knoppix.bat
./qemu/vl.c
./qemu/qemu-tech.html
./qemu/qemu-win.bat
./qemu/README-en.txt
./qemu/README-ja.txt
./qemu/SDL.dll
./qemu/vgabios.bin
./qemu/vgabios-cirrus.bin
./qemu/LICENSE
./qemu/LICENSE/LICENSE
./qemu/LICENSE/README-SDL.txt
./qemusaver
./qemusaver/qemusaver.iss
./qemusaver/Knosciences.scr
./qemusaver/knosciences-0.95.iso
./cdrom.ico
./SetupQemuSaver.exe
./Knosciences
./Knosciences/index.html
./Knosciences/knosciences-0.95.css
./Knosciences/knosciences-0.95.html
./Knosciences/labels.pl
./Knosciences/node1.html
./Knosciences/node10.html
./Knosciences/node100.html
./Knosciences/node101.html
..
./Knosciences/node97.html
./Knosciences/node98.html
./Knosciences/node99.html
./Knosciences/WARNINGS
./index.html
The autorun.bat file
The autorun.bat file (which is started when the CD is put in the reader/player) looks like this:
Listing 4. autorun.bat
@start SetupQemuSaver.exe
@start index.html
@cd qemu
@start /MIN qemu-knoppix
@exit
The qemu-knoppix.bat file
The qemu-knoppix.bat file (which starts the Knosciences demo as part of the autorun sequence) looks like this:
Listing 5. qemu-knoppix.bat
@echo off
REM KNOPPIX on Windows File System
REM Written by Japanese KNOPPIX TEAM 2004.08.17
REM Contact: knoppix@m.aist.go.jp
REM License GPL
REM If you get iso image of KNOPPIX, please use the following options.
REM Join the following two lines before running this bat file; it was split for space purposes.
qemu.exe -L . -m 128 -boot d -cdrom ../qemusaver/knosciences-0.95.iso -user-net -enable-audio
-localtime
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
5 of 7 05/11/2015 07:45 AM
REM ^^^^^^^^^^^^^^^^^^^^^^^^^^
exit
Shell to create the ISO image
The following shell function will create the ISO image. You can also create the CD under Windows; there is no requirement for the
CD to be bootable.
Listing 6. Constructing the ISO image
function remaster_mkisofs
{
mkdir -p ${wrkdir}/new_iso
mkisofs -pad -l -r -J -v -V "Knosciences" \
-hide-rr-moved \
-publisher "OFSET http://www.ofset.org/" \
-p "http://www.ofset.org/" \
-volset "Knosciences 0.95 for Windows (knosciences 0.95 with QEMU 0.7.2)" \
-o ${wrkdir}/new_iso/freeduc.iso ${wrkdir}/files
}
That's really all it takes to install Linux from a LiveCD to run as a screensaver on a Windows machine. Have fun with it!
Resources
Learn
Learn more about LiveCD technology and Linux in these articles:
"
Spin up a Linux LiveCD
" (developerWorks, July 2004) gives background on how to use LiveCD.
"
Assess system security using a Linux LiveCD
" (developerWorks, July 2005) helps you size up vulnerabilities without
lengthy installation and configuration.
In "
Open source licensing, Part 1: The intent
" (developerWorks, October 2005), Martin Streicher describes copyrights and
open source licenses.
In
Open source licensing, Part 2: Academic v. reciprocal
(developerWorks, November 2005), Streicher continues by exploring
the two most popular forms of open source licenses: the academic license and the reciprocal license.
Follow the "
Windows-to-Linux roadmap
" (developerWorks, November 2003) to migrate your skills from a Windows
environment to a Linux one.
"
Write emulator-friendly Linux code
" (developerWorks, December 2004) examines what emulators do and looks at hardware
and software emulation issues in detail.
"
OS/2 Warp migration information
" provides vital information on where to go from OS/2, soon to take its place in the
operating system history book.
Innovation Opens Up
describes IBM's strategic view of the future.
In the
developerWorks Linux zone
, find more resources for Linux developers.
Stay current with
developerWorks technical events and Webcasts
.
Get products and technologies
GamesKnoppix 3.7-0.1
, a Live Linux ISO built by students at the University of Kaiserslautern, Germany, includes support for
various 3D graphics adapters, gamepads, and the xsnow animated wallpaper.
freeduc-cd 1.4.1
is a Live Linux ISO built by the Organization for Free Software in Education and Teaching, and sponsored by
the United Nations Educational, Scientific, and Cultural Organization.
Knosciences
is a Live Linux CD built by Nathalie Carrie and Arnaud Verhille, science teachers on Reunion Island, a French
colony in the Indian Ocean.
Harmony
is an attempt to create a compatible, independent implementation of J2SE 5 under the Apache License 2.0. Register
for the
Apache Harmony developer kit
.
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
6 of 7 05/11/2015 07:45 AM
QEMU
is an open source PC emulator written by Fabrice Ballard.
Minimalist GNU for Windows
packages include
MSYS
,
msysDTK
, and
MinGW
.
The
Simple Direct Layer
is used by QEMU to access screen, keyboard, and mouse. The author uses the
SDL 1.2.8 package
,
zlib 1.2.2
(compression library), and
directx
(for use under Windows).
Inno Setup
is an open source application that constructs installation packages for use under Windows.
The
source code for UNESCO Linux
is hosted at National Taiwan University.
LinuxTracker
is one of many "watering holes" for people who wish to exchange free open source software (it uses the
BitTorrent method of distribution). Software here is "as is" -- use at your own risk!
Order the SEK for Linux
, a two-DVD set containing the latest IBM trial software for Linux from DB2®, Lotus®, Rational®,
Tivoli®, and WebSphere®.
With
IBM trial software
, available for download directly from developerWorks, build your next development project on
Linux.
Discuss
Discuss QEMU, the open-source PC emulator, at the
QEMU Forum
.
Participate in
developerWorks blogs
and get involved in the
developerWorks community
.
About the author
Chris Ward joined IBM from Cambridge University, England, in 1982. He has watched hard disks come and go. He has
watched OS/2 come and go. He has seen both Windows and Linux come, and neither has gone yet. He has written about
BlueGene/L for the
IBM Journal of Research and Development
. And he will invent and create anything for any
commercial client of IBM or any charity or school supported by IBM's
On Demand Community
. Contact Chris at
tjcw@uk.ibm.com
.
Linux screensaver for Windows http://web.archive.org/web/20060820222002/http://www-12...
7 of 7 05/11/2015 07:45 AM

Supplementary resources (16)

ResearchGate has not been able to resolve any references for this publication.