Personalize Your OS/2 Warp Boot Screen

From EDM2
Revision as of 16:29, 8 October 2020 by Ak120 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

by Allen Wynn and Joe Polimeni

OS/2 Warp has a fresh, new, snappy boot screen that is consistent with the rest of the product. Although we really like the boot screen, you might want to personalize it with a picture of your spouse, pet, company logo, or anything else. With OS/2 Warp, you can create your own personalized boot screen; this article shows you how to do it!

Wonder where OS/2 Warp gets its boot screen? It's in a hidden file in the root called OS2LOGO. Unhide OS2LOGO with the ATTRIB utility, and you can replace, or even erase, your boot screen file. If you erase the OS2LOGO file, OS/2 displays its copyright (and US Government restriction for the US version) only as the system boots. Replace the OS2LOGO file with another OS2LOGO file, and you change the boot screen. Simple, eh?

The difficulty lies in the file format. In the first phase of booting, we can display graphics using real-mode services only. One option was the PM bitmap format, however, the processing time was prohibitive given the limited capabilities this early in the boot process. So, we looked to the Video RAM. The Video RAM is directly accessible, and an easy way to display the logo would be to rewrite a saved copy of Video RAM. But OS/2 Warp was designed for speed and the time to read 153,600 bytes from disk was prohibitive, so we looked to compression. Compressing the Video RAM file not only saves disk space (allowing sufficient room for device drivers), it improves performance.

Note: Decompression time is negligible compared to disk I/O.

So, the five basic steps to creating your OS2LOGO file are:

  1. Display the image.
  2. Capture the data.
  3. Modify the data.
  4. Run MAKELOGO utility (available on the accompanying Developer Connection for OS/2 CD-ROM in the "Productivity Tools" category).
  5. Replace the OS2LOGO file.

Display the Image

First, you must display the image on a system running the OS/2 Warp debug kernel. An easy way to do this is to display a bitmap as the desktop background on a system running in VGA mode. Make sure you are not running in XGA or SVGA mode. Open the System Setup folder, and open the System icon. If it shows any screen resolution other than 640x480x16, the system isn't running in VGA mode. You can force the system to VGA mode by restarting the system, pressing ALT + F1 when the little white box is in the upper, left-hand corner, and choosing V (Reset to VGA) from the menu.

Second, move the icons and mouse pointer to the bottom of the screen (unless you actually want them on the boot screen). The top 5/6 of the screen will become your boot screen. The bottom 1/6 will be cropped; that's where the copyright goes.

Capture the Data

Now, move to the debug terminal that is connected to your OS/2 Warp system. You must collect the memory associated with the four video planes (red, green, blue, and intensity). Sounds hard, but you can collect each plane by using 7 simple kernel debug instructions while the debugger is logging. The input files to MAKELOGO must be VRAM0.DAT, VRAM1.DAT, VRAM2.DAT, and VRAM3.DAT, so you might as well log to these files. (Most debuggers have a logging feature, which lets you capture data.) Issue the following debug commands while logging to:

 VRAM0.DAT:

     3C4,2
     3C5,1
     3CE,4
     3CF,0
     dw %%a0000 L4B00
     3C4,2
     3C5,f

 VRAM1.DAT:

     3C4,2
     3C5,2
     3CE,4
     3CF,1
     dw %%a0000 L4B00
     3C4,2
     3C5,f

 VRAM2.DAT:

     3C4,2
     3C5,4
     3CE,4
     3CF,2
     dw %%a0000 L4B00
     3C4,2
     3C5,f

 VRAM3.DAT:

     3C4,2
     3C5,8
     3CE,4
     3CF,3
     dw %%a0000 L4B00
     3C4,2
     3C5,f

The Details

If you have a "yearn" to know the gory details, the following describes the debug commands in more detail. If you just want to "do it" without trying to understand each command, you can skip to the "Modifying the Data" section.

The 3C4 register is the Sequencer Address Register. Writing a value to the 3C4 register makes one of the Sequencer Registers addressable using the 3C5 register. Writing a 2 to the Sequencer Address Register makes the Map Mask Register addressable through the 3C5 register.

The system defines the Map Mask Register as: Bit Function Color (Mode x12)

7-4 Reserved
3 Map 3 Enable Intensity
2 Map 2 Enable Red
1 Map 1 Enable Green
0 Map 0 Enable Blue

By setting one of bits 3 through 0 to 1, the system can access a single video memory map at physical address A0000. Do this for each video memory map, in turn.

The 3CE register is the Graphics Controller Address Register. Writing a value to the 3CE register makes one of the Graphics Controller registers addressable using the 3CF register. Writing a 4 to the Graphics Controller Address Register makes the Read Map Select Register addressable through the 3CF register.

OS/2 uses the Read Map Select Register to select the video memory map that the system uses for read operations. OS/2 defines the Read Map Select Register as:

Bit Function
7-2 Reserved
1,0 Map Select (0=blue, 1=green, 2=red, 3=intensity)

The video memory map that OS/2 selects with the Read Map Select Register should match the video memory map enabled with the Map Select Register.

The dw %%a0000 L4B00 debug command causes the OS/2 debug kernel to display 4B00h (19200 decimal) words of data from physical address A0000. This dumps the video memory map selected with the Map Mask Register and the Read Map Select Register.

After you capture the data from each video memory map, a value of F should be written to the Map Mask Register. This indicates that all maps are enabled.

Modifying the Data

The commands that you issue will be in the log file; they must be removed before using the MAKELOGO utility. Edit the data files to remove those commands, as well as all of the blank lines at the top and bottom. The format of the data should be:

%%000a0000  ffff ffff ffff ffff ffff ffff ffff ffff
%%000a0010  ffff ffff ffff ffff ffff ffff ffff ffff
%%000a0020  ffff ffff ffff ffff ffff ffff ffff ffff

All of the .DAT files should be the same size, 127201 bytes. If any file is a different size, recollect it. Some data might have been lost during transmission between the OS/2 kernel debugger and the debug terminal.

Sample data files are available on your accompanying Developer Connection for OS/2 CD-ROM in the "Source Code from the Developer Connection News" category.

Run the MAKELOGO Utility

When you run the MAKELOGO utility (supplied on your accompanying Developer Connection for OS/2 CD-ROM), it expects to find the following files, VRAM0.DAT, VRAM1.DAT, VRAM2.DAT, and VRAM3.DAT in the current directory. It produces a file called VRAM.DAT. Rename VRAM.DAT to OS2LOGO; it's your new OS/2 Warp boot logo!

Replace the OS2LOGO File

Now go to your OS/2 Warp machine - it's time to replace the original OS2LOGO file in the root with your new file.

First, use the ATTRIB utility to remove the HIDDEN, SYSTEM, and READ-ONLY attributes from OS2LOGO, as follows:

attrib -r -s -h os2logo

Next, copy your new OS2LOGO file over the old OS2LOGO file. Reboot and enjoy.

Note: Check out your accompanying Developer Connection for OS/2 CD-ROM. We've provided two sample boot logos for you to experiment with. They're in the "Source Code from The Developer Connection News" category.

Conclusion

Now you know the secret of the OS/2 boot screen. Changing your OS/2 boot screen is not as easy as changing your desktop background, but it's simple enough that anyone familiar with the OS/2 kernel debugger should be able to boot with just about any image they want. Create a clever little .CMD file, add it to your Startup folder or STARTUP.CMD, and you could change your boot screen for every boot.

The replaceable OS/2 boot screen is just one the great new features of OS/2 Warp!

References

  • IBM Personal System/2 Hardware Interface Technical Reference - Common Interfaces

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation