How to Set Up ttylinux
under the Bochs Emulator


Web Presentation and Text Copyright©2013 by Daniel B. Sedory;
except for any direct quotes or images from Bochs or ttylinux, of course.
(NOT to be reproduced in any form without Permission of the Author !)


If you have not yet done so, please install the Bochs Emulator under your OS Platform. Although most of the following will apply only to those using Microsoft® Windows™, some of this page will also be useful to those running a Linux distribution as well. To install Bochs, please see our How to Set Up and Run the Bochs Emulator page with dlxlinux, and be sure to download the ttylinux-virtio_i486-16.1.iso.gz file from the ttylinux web site.

The following assumes you already have BOCHS installed on your PC, and know how to navigate to its install location. On a Windows™ PC, this should be: "C:\Program Files\Bochs-2.6.2\" (or whatever current version of Bochs is installed as the folder name). Let's begin:

NOTE: If you simply want to learn about various linux commands using the ttylinux .ISO file, there's no need to create a new disk image under Bochs or to use another directory. Simply edit the "bochsrc.bxrc" file in the dlxlinux folder according to steps 9 - 11 below, and you can boot-up from the Virtio i486 (or try some other CD image file; note: others may require a lot more memory and take much longer to boot-up!) as shown in steps 14 - 16. Compared to dlxlinux, these image files have most, if not all, of the essential commands, and none are 'broken'; e.g., "shutdown -h" will actually shut off the emulation and there's a "halt" function as well, which will stop the OS, but not poweroff the emulation. And they all run on much more recent Linux kernel versions.

========================================================================
                                bximage
                  Disk Image Creation Tool for Bochs
          $Id: bximage.c 11315 2012-08-05 18:13:38Z vruppert $
========================================================================

Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd]  Press ENTER key!

What kind of image should I create?
Please type flat, sparse or growing. [flat]  Press ENTER key!

Enter the hard disk size in megabytes, between 1 and 8257535
[10] 180  Type 180, then press ENTER key!

I will create a 'flat' hard disk image with
  cyl=365
  heads=16
  sectors per track=63
  total sectors=367920
  total size=179.65 megabytes

What should I name the image?
[c.img] hda.img  Type hda.img, then press ENTER key!

Writing: [] Done.

I wrote 188375040 bytes to hda.img.

The following line should appear in your bochsrc:
  ata0-master: type=disk, path="hda.img", mode=flat, cylinders=365,
 heads=16, spt=63
(The line is stored in your windows clipboard, use CTRL-V to paste)

Press any key to continue
_
========================================================================
                                bximage
                  Disk Image Creation Tool for Bochs
          $Id: bximage.c 11315 2012-08-05 18:13:38Z vruppert $
========================================================================

Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd] fd  Type fd, then press ENTER key!

Choose the size of floppy disk image to create, in megabytes.
Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.
 [1.44]  Press ENTER key!
I will create a floppy image with
  cyl=80
  heads=2
  sectors per track=18
  total sectors=2880
  total bytes=1474560

What should I name the image?
[a.img]  Press ENTER key! (Change to b.img 2nd time through.)

Writing: [] Done.

I wrote 1474560 bytes to a.img.

The following line should appear in your bochsrc:
  floppya: image="a.img", status=inserted
(The line is stored in your windows clipboard, use CTRL-V to paste)

Press any key to continue
_

# fdisk -l

Disk /dev/hda: 188 MB, 188375040 bytes
255 heads, 63 sectors/track, 22 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/hda doesn't contain a valid partition table
# fdisk /dev/hda
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT di
sklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.


Command (m for help): c  (ENTER c to turn off DOS Compatibility.)
DOS Compatibility flag is not set

Command (m for help): x  (ENTER x to access additional 'expert' commands.)

Expert command (m for help): c  (ENTER c to change number of cylinders.)
Number of cylinders (1-1048576, default 22): 365  (ENTER 365.)

Expert command (m for help): h  (ENTER h to change number of heads.)
Number of heads (1-256, default 255): 16  (ENTER 16.)

Expert command (m for help):r  (ENTER r to return to main menu.)

Command (m for help): n  (ENTER n to create a new partition.)
Command action
   e   extended
   p   primary partition (1-4)
p  (ENTER 'p' to create a primary partition.)
Partition number (1-4): 1  (ENTER a 1.)
First cylinder (1-365, default 1):  Press the ENTER key (to use '1')!
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-365, default 365): 49
                                                                 (ENTER 49.)
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2  (ENTER a 2.)
First cylinder (50-365, default 50):  Press the ENTER key (to use '50')!
Using default value 50
Last cylinder or +size or +sizeM or +sizeK (50-365, default 365): 114
                                                                  (ENTER 114.)
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3  (ENTER a 3.)
First cylinder (115-365, default 115):  Press the ENTER key (to use '115')!
Using default value 115
Last cylinder or +size or +sizeM or +sizeK (115-365, default 365): Press the
Using default value 365                                          ENTER key!

Command (m for help): p  (ENTER 'p' to print summary of partition table.)

Disk /dev/hda: 188 MB, 188375040 bytes
16 heads, 63 sectors/track, 365 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/hda1               1          49       24695+ 83 Linux
/dev/hda2              50         114       32760  83 Linux
/dev/hda3             115         365      126504  83 Linux

Command (m for help): w  
The partition table has been altered.
Calling ioctl() to re-read partition table
# ttylinux-installer --config=install.conf /dev/hdb
Listing device partition format options:
...will format /dev/hda3 as ext3
...will format /dev/hda2 as swap
...will format /dev/hda1 as ext3
Making file systems:
-> mkfs.ext3 on /dev/hda3
-> mkswap on /dev/hda2
Setting up swapspace version 1, size = 32509952 bytes
UUID=15fb943a-9f11-4868-8c7c-8b9166982c0e
-> mkfs.ext3 on /dev/hda1
Mounting file systems:
-> mount [ext3] /dev/hda3 at /tmp/ttylinux/targt/
-> mount [ext3] /dev/hda1 at /tmp/ttylinux/targt/boot
i> Mounting ttylinux CD-ROM on /dev/hdb ... OK
i> Installing ttylinux distribution packages.
   ***** Installing ttylinux-i486-16.1
=> bash-4.2
=> busybox-1.21.0
=> dropbear-2013.58
=> e2fsprogs-1.42.7
=> glibc-2.9
=> iptables-1.4.18
=> lilo-23.2
=> ncurses-5.9
=> retawq-0.2.6c
=> thttpd-2.25b
=> ttylinux-basefs-1.0
=> ttylinux-devfs-1.0
=> ttylinux-utils-1.5
i> Installing ttylinux distribution data [/ttylinux] ... DONE
i> Copying ttylinux kernel ....... OK
i> Unmounting ttylinux CD-ROM on /dev/hdb ... OK
i> Installing LILO boot loader.
Warning: Unable to determine video adapter in use in the present system.
Warning: Video adapter does not support VESA BIOS extensions needed for
  display of 256 colors.  Boot loader will fall back to TEXT only operation.
Added ttylinux  *
2 warnings were issued.
-> umount /dev/hda1 from /tmp/ttylinux/targt/boot
-> umount /dev/hda3 from /tmp/ttylinux/targt/

i> Installation complete.

 


More will be posted in the near future... this page is still Under Construction !!!

If you need any help in setting up the Bochs Debugger, please email us.


 


First Published: July 28, 2013 (28.07.13).
Last Update: July 29, 2013 (29.07.2013).


You can write to me using this: online reply form. (It opens in a new window.)

The Starman's x86 ASSEMBLY Pages

The Starman's Realm Index Page