How to change the SUN logo in the eeprom (sou
Alexander Dupuy
dupuy at douglass.cs.columbia.edu
Sat Dec 10 00:47:16 AEST 1988
The following program will do this.
[[ Use at your own risk! It diddles with the eeprom. I checked it on a
3/60 and it seems to work, but still.... --wnl ]]
: This is a shar archive. Extract with sh, not csh.
: The rest of this file will extract:
:
: booticon.c
:
echo x - booticon.c
sed 's/^X//' > booticon.c << '//go.sysin dd *'
X#include <stdio.h>
X#include <sys/file.h>
X#include <sys/types.h>
X#include <pixrect/pixrect.h>
X#include <pixrect/memvar.h>
X#include <suntool/icon_load.h>
X
X#ifdef lint
X#ifndef NBBY
X#define off_t long
X#endif
X#endif
X
Xmain (argc, argv)
Xint argc;
Xchar **argv;
X{
X int eeprom;
X char message[256];
X Pixrect *icon;
X extern off_t lseek ();
X
X if (argc != 2)
X {
X (void) fprintf (stderr, "usage: %s default|iconfile\n", argv[0]);
X exit (1);
X }
X
X if ((eeprom = open ("/dev/eeprom", O_WRONLY)) < 0)
X perror ("/dev/eeprom"), exit (1);
X
X if (!strcmp ("default", argv[1]))
X {
X if (lseek (eeprom, (off_t) 0x18f, L_SET) < 0)
X perror ("seek"), exit (1);
X if (write (eeprom, "", 1) < 1)
X perror ("write"), exit (1);
X exit (0);
X }
X
X if ((icon = icon_load_mpr (argv[1], message)) == NULL)
X (void) fprintf (stderr, "%s", message), exit (1);
X
X if (icon->pr_depth != 1)
X (void) fprintf (stderr, "Not a monochrome icon!\n"), exit (1);
X
X if (icon->pr_width != 64 || icon->pr_height != 64)
X (void) fprintf (stderr, "Not a 64 x 64 icon!\n"), exit (1);
X
X if (lseek (eeprom, (off_t) 0x18f, L_SET) < 0)
X perror ("seek"), exit (1);
X if (write (eeprom, "\022", 1) < 1)
X perror ("write"), exit (1);
X
X if (lseek (eeprom, (off_t) 0x290, L_SET) < 0)
X perror ("seek"), exit (1);
X if (write (eeprom, (char *) mpr_d (icon)->md_image, 0x200) < 0x200)
X perror ("write"), exit (1);
X
X (void) system ("/usr/etc/eeprom -c >/dev/null 2>&1"); /* the lazy way */
X
X exit (0);
X}
//go.sysin dd *
exit
--
inet: dupuy at columbia.edu
uucp: ...!rutgers!columbia!dupuy
More information about the Comp.sys.sun
mailing list