Topic: How To
I have found that the following Windows games work fine under Debian Linux using standard WINE:
- Space Empires IV
- Starcraft
- Streets of SimCity
I assume the computer which I will install linux on will be on a network that has internet access. This installation will boot the computer off a set of three floppies, which will then use the network to download and install the rest of the operating system. If your only connection to the internet is a windows pc with a modem, you'll need to find a proxy or ip forwarding program for windows.
1b. Determine what TCP/IP network settings your new system must have. you will need an IP Address, subnet mask, gateway, domain name and dns server ip addresses. On a windows 9x machine, you can retrieve most of this information from either network settings or by running 'winipcfg'. on a NT/2000 box, run ipconfig instead of winipcfg.
For example, for the AT-2000 Allied Telesis ISA Ethernet card, I need the 'ne'
module (NE cards), and configure it with the i/o address (same as in windows)
in the /etc/modules file with the line:
ne io=0x300Mor on the command line:
insmod ne io=0x300which installs the ne module into the operating system with the option (io=0x300)
For the TE100-PCIWA/N 10/100 PCI Fast Ethernet cards, I needed the rtl8139 module and
don't need any options, so in /etc/modules, I just put:
rtl8139or from the command line:
insmod rtl8139
I will talk about the /etc/modules file and the insmod program later in this document.
Either go to the download directory at:
ftp://ftp.us.debian.org/debian/dists/potato/main/disks-i386/2.2.26-2001-06-14/images-1.44/compact/Or (if the link doesn't work) follow these general steps to get to the download directory:
Go to www.debian.org. On the left bar, go to 'Download with FTP' under 'Distribution' Choose '(FTP)' next to 'United States', or some other server if too slow. Go to 'dists' (for distributions). Go to 'stable' (for the standard stable release of Debian). Go to 'main'. Go to 'disks-i386' (disks for PC-compatible systems). Go to 'current' Go to 'images-1.44' (for standard sized floppies). Go to 'compact' (for fewest floppies)Then download the three floppy images:
driver-1.bin rescue.bin root.bin
Go to:
http://uranus.it.swin.edu.au/~jn/linux/rawwrite.htmor go to google and search for RawWrite.
The version of RawWrite I have seems to have a bug where every other time you try to write the image, it reports a failure immediately, but trying again works fine. There is also a DOS program rawrite.exe that does not have this bug. Look on Google for it if you're interested.
Label each diskette with the name of the file you created it with.
3a: Insert the 'rescue' floppy into the target PC and turn it on. You should get a screen like the following:
|
Press the Enter key.
A bunch of text will scroll down the screen until it gets to a line that says: VFS: Insert root floppy disk to be loaded into the RAM disk and press ENTER
Now remove the rescue disk, insert the root disk, and press Enter.
A window with a menu will then appear titled 'Debian GNU/Linux Installation Main Menu' and
will look something like:
Then choose 'Partition a Hard Disk', which is probably already selected.
A warning about disk size will appear. just hit enter.
you will now be in a disk partitioning program. the screen will look like this:
You will be returned to the main menu.
Choose Initialize and Activate a Swap Partition, which is proably already selected.
The swap partition you just created will be listed, hit enter to accept.
You will be prompted to perform a disk scan of the partition. choose 'yes' to skip the scan
and hit enter.
Back at the main menu - choose Initialize a Linux Partition.
At this point you will deviate a little from the installer's suggestions.
Back at the main menu, accept the default 'Configure Device Driver Modules'.
select the 'net' category.
if you had any module parameters required for your card, enter them here. for the network
card examples I gave in step 1, for the 'ne' card, I would enter io=0x300 here. for the
rtl8139 card, I would leave this blank. Hit enter to accept.
A screen should then appear:
Hit enter.
If the network setup was successful, you will now be back at the main installation screen.
After downloading completes, the base system will be extracted.
Back at the Main Menu, choose 'Configure the Base System', which is probably already selected.
Back at the Main Menu, choose 'Make Linux Bootable Directly From Hard Disk', which is probably already
selected.
Back at the Main Menu, choose 'Make a Boot Floppy.', which is probably already selected.
When prompted, insert a new disk to use as a boot floppy, and hit enter. The boot floppy
format screen will display:
After it is complete, you will be returned Main Menu.
Remove the floppy from the drive and choose 'Reboot the System', which is probably selected.
If all went well, when the computer reboots, linux will start.
The next line will then say:
RAMDISK: Compressed image found at block 0
and the computer will read from the floppy again.
some more text will scroll down the screen and then a ASCII window will pop up titled
'Release Notes' with a
This window will guide you through the installation of the 'base system'. +------------------------------| Title |-------------------------------+
| |
| Your keyboard has not yet been configured. Please select |
| "Next" from the menu to configure the keyboard. |
| |
| +------------------------------------------------------------------+ |
| | Next : Configure the Keyboard | |
| | Alternate : Preload essential modules from a floppy | |
| | Alternate1: Partition a Hard Disk | |
| | | |
| | Configure the Keyboard | |
| | Preload modules from a floppy | |
| | Partition a Hard Disk | |
| | Initialize and Activate a Swap Partition | |
| | Activate a Previously-Installed Swap Partition | |
| | Do Without a Swap Partition | |
| | Initialize a Linux Partition | |
| | Mount a Previously-Initialized Partition | |
| | Unmount a Partition | |
| +------------------------------------------------------------------+ |
| |
+----------------------------------------------------------------------+
First choose 'Configure the Keyboard', which is probably already selected.
Choose the default 'U.S. English (QWERTY)' unless you need something different.
The 'Select Disk Drive' window will appear. all of your harddisks will be listed here.
the master drive on the primary IDE channel will be listed as /dev/hda, the slave drive
on the primary IDE channel will be /dev/hdb, the secondary master will be /dev/hdc,
and the secondary slave will be /dev/hdd. Unless you are setting up a dual boot system
or have multiple hard disks in your computer, you will have a single value in the
list, and you will want to just hit Enter.
Selected in the table is the current partition, which is your entire drive right now.
at the bottom, the Help button is selected. Use the right and left arrow keys to move to
the New button and hit enter, to create a new partition.
cfdisk x.xxx
Disk Drive: /dev/hdx
Size: xxx bytes
Heads: xx Sectors per Track: xx Cylinders: xxxx
Name Flags Part Type FS Type [Label] Size(MB)
------------------------------------------------------------------------
Pri/Log Free Space 639.96
[ Help ] [ New ] [ Print ] [ Quit ] [ Units ]
[ Write ]
Print help screen
choose the Primary button.
the program will ask for the size of the partition. Take the current listed size, and
subtract 2 times the amount of memory your system has installed. for example, in the above
the system has 639.96 mb of harddisk space, and 16 mb of memory. so 639.96 - 32 = 607.96 mb.
Choose the Beginning button.
Choose the Bootable button, to make the partition bootable.
you will now have two entries in the table above. The first will have the FS Type of Linux,
and in this case will have Size of 607.95. The second will have Free Space for FS Type and
in this case will have Size of 32.00. use the up and down arrow keys to select the second partition.
use the right and left keys again to select New again and hit enter.
Choose the primary button again.
Hit enter when prompted for size, to accept the default.
Use the arrow keys to select 'Type' and hit enter.
Enter 82 (for Linux Swap) for the filesystem type and hit enter.
You will now have two partitions in the list, the first will have the Boot Flags, and will
have Linux for FS Type. the second will have no flags and will have Linux swap for FS Type.
Choose the Write button.
Type 'yes' to confirm your configuration, and hit enter.
Choose the Quit button.
Choose 'yes' to confirm initialization.
the first partition you created will be listed. hit enter to accept.
you may be prompted about version compatibility. choose the default 'yes'.
you will be asked about a disk scan for this partition. choose 'yes' to skip the scan and
hit enter.
choose yes to confirm the format of the partition.
The drive will now be formatted.
you will be asked if you want to mount the 'root' filesystem now. choose yes.
Back at the main menu, choose 'Install Operating system kernel and modules' instead of
the default.
Choose the first floppy drive. Put the rescue floppy in the drive when prompted and hit
enter.
When prompted, insert the driver disk and hit enter.
choose 'yes' to skip the next step.
You will then be given the module list menu: +--------------------------| Select Category |---------------------------+
| |
| blah blah blah blah blah blah blah blah blah blah blah blah blah |
| blah blah blah blah blah blah blah blah blah blah blah blah blah |
| |
| Please select the category of modules. |
| |
| Exit Finished with these modules. Return to previous menu. |
| |
| block Disks and disk-like devices. |
| cdrom Device drivers for CD-ROM drives. |
| fs Drivers taht allow many different filesystems to be accessed |
| misc Drivers that don't fit in the other categories. |
| net Drivers for network interface cards and network protocols. |
| scsi Drivers for SCSI controller cards and classes of SCSI device |
| |
| |
| [OK] [CANCEL] |
| |
+------------------------------------------------------------------------+
go down the next list until you find the network driver you need for your network card, which
you found in step 1. select it and hit enter.
choose
The following window will appear:+--------------------| Enter Command-Line Arguments |--------------------+
| |
| Please enter any command-line arguments for the rtl8139 module. Many |
| modules can autoprobe and do not require additional parameters. |
| |
| _____________________________________________________________________ |
| [OK] [CANCEL] |
| |
+------------------------------------------------------------------------+
Installing module xxxxxxxx. If the device isn't there, or isn't configured correctly,
this could cause your system to pause for up to a minute.
if you did not get the Installation succeeded text, you need to verify your network hardware,
and perhaps search google again for more information about it, and try again.
Exit the net-modules list (unless you need to try again, or have another network card).
You will be returned to the main module list window.
Exit the modules list.
You will be returned to the main installation window.
Choose the default 'Configure the Network'.
You will be asked to give your computer a name. do so and hit enter.
you will be asked if you want to perform automatic network configuration. Unless you know
you are connected to a network that will assign your settings for you, choose no.
Enter your IP address and hit enter.
Enter your subset mask and hit enter.
enter your gateway IP and hit enter.
enter your domain name and hit enter.
enter your dns server IP and hit enter.
choose the default 'install the base system'.
choose 'network : retrieve from network'.
hit enter to confirm starting the http download.
you will be given the 'select installation server' window. select the
You will see the download progress window.
+--------------------------| Download Screen |---------------------------+
| |
| Put Download Screen Here. |
| blah blah blah blah blah blah blah blah blah blah blah blah blah |
| |
| |
| |
| [CANCEL] |
| |
+------------------------------------------------------------------------+
Select your timezone. In the 'Directories' list, choose 'US', then in the Timezones list
choose the appropriate timezone.
Choose 'Yes' to set your hardware clock to GMT.
Use the default in the next screen, "/dev/hdx : Install Lilo in the MBR (use this if unsure).". (If linux
does not boot later and you have to repeat the install, try the other option, but the first should work)
If for some reason your installation will not boot straight from the harddrive, this gives
you a way to continue without having to re-install.
Formatting the floppy...
Measuring drive N's raw capacity
In order to avoid this time consuming measurement in the future,
add the following line to /etc/driveprm:
driveN: deviation=xxxx
CAUTION: The line is drive and controller specific, so it should be
removed before inserting a new drive N or floppy controller.
Formatting cylinder XX, head X
A warning screen will appear. Choose 'Yes' to reboot.
So in no particular order:
For a bunch of reasons, Java has two ways to represent all the basic numerical values, both of which must be used if you are doing anything slightly complicated. For example, you can either use the double built-in type, or you can use the Double object. The double object lets you do normal arithmetic the way you'd expect:
double a = 1.0; double b = 1.0; double c = a + b;But you can't do that with Double because it's an object and Java doesn't allow operator overloading even for obvious cases for Sun-provided objects like Double. You have to do clumsy things like:
Double a = new Double(1.0); Double b = new Double(1.0); Double c = new Double(a.doubleValue() + b.doubleValue());So just use double, right? Except you can't use double in any of the built-in collections like Array, List, or Map. The java collections all require real Objects, so you're stuck wrapping your double in a Double to store it in an Array, then unwrapping it to do any real work (like, say, addition) on it, then wrapping it all up in a Double again when you need to put it back:
List inputs = new LinkedList(); List outputs = new LinkedList(); inputs.add(new Double(1.5)); Iterator li=inputs.iterator(); while(li.hasNext()) { double result = 2.0 * ((Double)li.next()).doubleValue(); outputs.add(new Double(result)); }Brilliant. This example also leads nicely into:
Java collections are powerful. You can store anything in them. Java handles this in a simple way by having all the collections work by taking Objects as the collection elements, and then forcing every other class to inherit from the base Object class. This lets you do stuff like:
List l = new LinkedList(); l.add(new Double(3)); l.add(new String("Hello")); l.add(new LinkedList()); l.add(new Boat("Titanic"));...because all of these objects are Objects. But what if you know what kind of list you want? Say you want an object method to take a list of Persons?
public class Airplane { board(List passengers) { Iterator li=passengers.iterator(); while(li.hasNext()) { seat((Person)li.next()); } } } ... List passengers = new List(); passengers.add(new Person("Fred")); passengers.add(new Person("Bob")); passengers.add(new Person("Jill")); passengers.add(new Bomb("Nuclear")); //no problem! Airplane.board(passengers);The Airplane class can only see a list of objects that it trusts are Persons, but someone could always insert something else into the list. If you want any kind of typechecking on the List, you have to create yet another class that extends List. In C++, for example, this kind of thing would be a one-liner using templates (which I'm not that fond of, but it beats the heck out of having yet-another-java-class).
Granted, you probably should never ever need methods this long, but this is still a retarded limitation to even have:
Exception in thread "main" java.lang.ClassFormatError: */*/*/* (Code of a method longer than 65535 bytes)Oh, and this is a run-time limitation. The compiler won't catch you on this one, even though if anyone knows the number of bytes in a method, the compiler should. [For the record, I was trying something intentionally dumb for testing purposes (initializing an array with ~100,000 records) when I ran into this.]