Sunday, 31 May 2009

Utilizing Virtual Box

I have the GParted.iso image saved somewhere in my computer and want to test it and become familiar with it. I have not burnt it yet to a CD ROM. I open my xVM VirtualBox and mount this ISO image on it by browsing to its saved folder. These all intuitively can be done. Then I start my virtual machine. I already had selected "Other" as name of machine to remember that type of my virtual machine is unspecified. When machine starts it automatically finds the mounted image and then GParted loads. I find it better to use graphical default GParted for a non-partitioned hard disk. In GParted GUI menu I create these partitions: first an extended 2GB second a primary 9Gb and third a primary 9Gb. I create three logical partition inside the first extended partition: first a 16Mb FAT16 for XOSL (it comes as 24Mb) then an ex2 logical with 250Mb capacity and remaining FAT32 for Freedos. I format next primary partition with NTFS for my first XP Windows. I leave the last partition for later. That I selected extended partition as first partition was to overpower myths regarding "first partition" usage. GParted promise is that that its partitions are rounded to "cylinder" but I cannot rely on that due to the fact that in its GUI I could not find any option for selecting number of heads. When you normalise the geometry of the partition and read CHS (Cylinder, Head, Sector), say by Ranish partition tools sometimes you get fractions. It is better to do a basic partitioning and then restart GParted in its "Debian" command lines and, using fdisk utility, fine tune partitions based on a CHS calculated as H=255, S=63 and C should be got through calculations, rather than default of GParted that uses only H=16. This default gives thousands of cylinder. For H=255 and S=63 each roughly 8Mb is one cylinder. Hence, for 24Mb I select 3 cylinders, for 250Mb I select 30 cylinders for Freedos I select 220 cylinders and so on.

Saturday, 30 May 2009

Working with Virtual Box

My goal is not to run a virtual desktop in my PC. I do that but not for the jobs I counted in previous post. Virtualization has found its applications mostly in corporate computing from the time that Novell introduced its workstation software for Microsoft server software to be installed in place of Windows 2000 workstation. One good usage of virtual boxes is to test beta and candidate software. For example, now I am doing it with Microsoft's future operating system Windows 7 RC with 30Gb of virtual hard disk. I can have it free for more than a year with VIP services of volunteer users. It is not advisable to install a not very stable operating system on a hard disk that contains side by side the missus's emails and social networking and her daily software, except that you like to sleep on the couch with the pooch. (Well, they don't rhyme.) Ergo, you put it safely on the virtual box and if it doesn't behave you simply drop everything in the recycle bin and start anew. Anyway, I was talking about my GParted virtual experiments. I do them with virtual hard disk and when I become confident that I have done everything correctly and all necessary details have been put on the paper and the risk of doing them on a roaring and working hard disk with valuable assets are almost nil then I transfer my experience on the live and kicking hard disk. This is the way that modern engineers do their jobs. When You send a box round the Mars and it takes five years for such a project you cannot revise it at its destination. Everything should work as it is drafted on the paper. One should predict unpredictable. One way of achieving that is procuring redundancy, that is, having alternative devices and slack paths in the project. Perhaps people can remember story of Titanic ship sank in 1912. In the design of the vessel, modern finance management for optimization of costs had forced design engineers to show their confidence by reducing the number of lifeboats to the half of the necessary items that should be predicated for saving all crews and passengers in a belief of a never-sinking vessel design. To that reason, why any boat should be provided at all; for fishing day-out of some passengers? Actually, a modern engineer should provide more than enough of lifeboats in redundancy, in case some rich people might avoid being crammed with smelly people in the same lifeboat on a sinking accident. That lesson in terms of computer means, "Always keep a backup for your valuable data!" The other trick of engineers is called "simulation." It means repeating the desired job in a safe environment and finding what is not predicted correctly and what goes wrong. Then eliminating those obstacles and moving to the harsher level of simulation such that their design can safely pass the worst case scenarios. My virtual box helps me to simulate things in a safe environment without harming valuable assets of others.

Friday, 29 May 2009

Using Virtual PC Box

I fell a bit far from my GParted discussion. My goal is to create comfortable environments for writing assembly codes and debugging and writing drivers. Meanwhile, I craft to make hardware more friendly for me. I created a custom GParted.iso that included some additional software to install GParted permanently on hard disk. I need it for partitioning and also to use its good command line "Debian" Linux flavour. If I simply install a GParted on the hard disk, later in case, running it from GParted Live CD may cause complications, such as locking the live version. Hence, I should always keep the option of running both from the hard disk and from the Live CD in my GRUB menu. To do that I put sbootmgr.dsk and memdisk files into the root of my customized ISO. Some advised that I should have memdisk.bin. The correct, as Linux advises, is just memdisk without .bin extension. I can take it from syslinux or isolinux folder in GParted. I get sbootmgr.dsk from here. Now I have my GParted.iso built by ImgBurn ready to be tested on My Sun's VirtualBox. I install VirtualBox and I open it. From the tool bar I select "New" and I follow GUI for creating a new virtual PC. For the type of PC operating system I have different options. I can select a Microsoft Windows, a Sun Solaris, a Linux, a Dos or finally an unspecified shown as "Other." I select this very last one. In this way I do not bound me to later default choices of VirtualBox. I select a 374Mb for the RAM of my virtual PC. A dynamically expandable virtual hard disk with generous 20Gb space later allows me to put my ideas better in practice. The goal is to just install two XP operating systems next to each other and some little things such as a DOS system and of course GParted and XOSL.

Thursday, 28 May 2009

Tools That I Need

I need tools to develop applications. Applications are pieces of software to do a task for me on my computer. I use any computer programming language to achieve that goal. To this end I do not need to use complicated software. Software that by its turn needs time to learn to utilize. I can use a notepad and carefully write my program on it avoiding mistakes, editing it as much as possible. But to test and run this program, I definitely need a compiler to translate my program to codes understandable by my CPU. When I get a compiler, frequently, provider of that compiler put a piece of software for you integrated with compiler that allows people to design and write and then run and test their programs in the environment integrated with the desired compiler and find their errors and correct them and re-run it again and again. This is called Integrated Development Environment (IDE). Some times IDEs can support environments for a panoply of compilers. An example of that is NetBeans IDE that supports numerous compilers such as Java, C (C++), and FORTRAN. There are facilities that shows errors on the fly and intelligently creates codes for you. Together I need tools to create database. With NetBeans I can have access to the very powerful and free database utilities suite, MySql. From within a Java application you can access to database created by MySql. Similarly, one might use Visual Studio free Express edition from Microsoft. It is the case when you like to develop your software in C, C++, or Visual Basic. It is very handy if one needs to develop programs for windows. It is called windows programming. From the Visual Studio suite one can install Microsoft SQL server for creating and running database from within the application. Good thing about Microsoft Visual C++ IDE is that I can write assembly codes and assemble them inside my project. A full blood debugging, that is watching CPU and memory in machine code is another story. One should leave other businesses to utilize them. It is also true for writing device drivers for kernel of an operating system.

Tuesday, 26 May 2009

Virtual Box

VMWare has a free virtual machine player. That player is not a virtual machine. Optimum virtual PC that I use is Virtual Box from Sun Microsystems. It is under constant development and informs you in periods of time, quarterly or sooner, of updated versions with enhanced features and is backed by Sun Microsystems technology. If you go here you can have a look at different useful development tools and click on Sun Virtual Box and then be guided to its download area. We know that sun is the first developer of a virtual machine, Java Virtual Machine (JVM). Job of JVM is different from virtual boxes I am discussing. JVM takes a piece of code from an application smashes it into the bytes. In this way that application becomes independent of length of the word of host computer and becomes portable over the Internet into the different platforms. It remains for that host computer to have a small free JVM installed in a corner. In real experience it facilitates things drastically. That said. some believe that it is a matter of habit mostly than technology. You have a set of tools at the Sun's place, you can have a similar set all free from Microsoft Visual Studio Express edition and a similar set free from IBM and similarly from Oracle. And I'll discuss them later, hopefully.

Sunday, 24 May 2009

Virtual Box

There are many virtual desktops available that I can use them. This software is a piece of application that I can install on my computer like any other application but when I run it, it gives me a virtual PC similar to my own computer. Now I can configure that virtual PC such that it is possible to install any operating system on it regardless your own running operating system. (Perhaps you have seen exotic California oranges that have a full orange inside their cores. I have seen some with a third one inside that core. One told me he had seen four layers to the core and as big as a melon.) For example I have an XP home edition operating system, but I can install a Sun Solaris operating system on my virtual PC and work inside that as if it is a Solaris machine. When you are running your virtual PC you have options to create one or more than one PC on it. They are called "machines." One can find different virtual PC software, some free and some purchasable. Best of them I have experienced with belongs VMWare. One can trial test it free, but after ending the trial period you have to purchase the licence should you opt to use them. Good point about VMWare is that it does not load the CPU much. You see, they are virtual so at the end of the day they have to use your very real CPU. And at the same time your CPU has to run your real operating system in the background for all the real jobs that your computer is doing including running of virtual PC software. The other good thing about VMWare is when you are running your own operating system additionally on virtual desktop. Then a conflict of licence key happens. VMWare can solve that conflict by negotiating the key with operating system vendor. One can configure VMWare as a target machine for debugging when developing driver software. You can virtually null terminate port of your debuggee to the debugger machine. These are somehow advanced and one cannot use a family computer for debuugging. (If you open the door to any debugger then you should separate all ordinary jobs to another computer.) After sometimes ease of working with virtual PC makes you so lazy that you almost forget that you need another machine for experiment or multibooting. Inside that machine any trouble is isolated from your real PC and if trouble continues you can safely delete the machine and its virtual hard disk. See, you have installed Solaris on your virtual machine and now it does not connects to network. You go on the Internet from your background PC and google for solutions. On the other hand, more sophisticated virtual PCs devour your CPU and need almost all of your physical memory. Microsoft virtual PC is free but not designed for my XP home edition. It works on XP-home, but gives you warning every time you turn it on. It also asks for licence key if you install your own XP on it. So you cannot run XP on it for more than thirty days.

Wednesday, 20 May 2009

Making Enhanced GParted ISO Image

To make GParted.iso bootable, ImgBurn helps us in finding the image of the floppy which can boot CDROM. Any bootable CD carries such an image. If one is very kin or perhaps uber-geek, he might build that manually himself. Later I delineate my own attempts on that. I already had selected "creating ISO image from a folder" from ImgBurn menu. On the right side of the user interface for this command there is a "tabbed" pane. I open the "Advanced" tab from this. There I can see another "tabbed" system and a "tab" for "Bootable Disc." When I check the box at the top for "Make Image Bootable" then it makes the input fields "enabled." I see that I can brows to target "boot image file" wherever it is. I had created an empty folder, as I already said, and had filled it with extract of original downloaded GParted.iso. I brows into this folder and then open isolinux folder. Inside that ImgBurn picks the isolinux.bin as the boot image for my enhanced Gparted ISO CD image. I leave every other things to ImgBurn defaults and confirm all other dialogues. ImgBurn creates desired image in a minute or two. I do not need to burn this image to test it. I use a virtual machine to that end.

Sunday, 17 May 2009

Building ISO Image

By the way I also need two additional files to be available in my custom made GParted.iso. One is memdisk and the other is sbootmgr.dsk. I need these later when I am configuring GRUB tools to access my Linux partition where I have installed GParted. One might be eager to utilize LILO for that. It is another challenge. GRUB install utility, grub-install comes with the GParted "Debian" terminal, but LILO should be worked out by you. XOSL can load both of them if they become configured properly. Now, I should build the ISO back. For that I use completely free ISO creator and burning tools ImgBurn from here . I believe when I use these excellent free tools it is not a bad idea to donate some money to their cause. It keeps the flame alight and is quite encouraging. I do that if I could. The tool "ImgBurn" has different options. We have a folder of GParted and we need an ISO image of it. We select this option from the "ImgBurn" easy select user interface. I should be careful to make the ISO "bootable."

Friday, 15 May 2009

Injecting Files into ISO Image

ISO images are read only files and one can't inject files into them. Hence to add some bits and pieces to my GParted.iso I need to extract the ISO into an ordinary folder and then inject, or rather add, extra files and folders to it. To be able to do that extraction Ther are two methods.
First, download a virtual drive software. This software instals a virtual CD/DVD driver on your computer similar to your real CD/DVD/Blu-ray driver. Only that instead of real CD/DVD/Blu-ray you put a an ISO image on it. Then you can open that image and copy the content of that image into your computer. Then add (inject) your additional files into the content. And at last create a second new ISO that includes the injected files. There are many virtual drivers out there, but the one that I have used is the free Daemon Tool Light When you are installing it be careful not to accept its optional features such as the toolbar if you do not agree with them. Only instal the virtual drive. Also download it from its official website; otherwise, you might end up downloading annoying bloated softwares and ad-wares. Also there are many other products are advertised in the page that you should carefully find Daemon download among them.
In second method, I downloaded WinImage tools from here. This tool is not free but you can use it for thirty days free and meanwhile sort out your projects. I created a new folder in "My Documents" named it with GParted ISO file, showing versions and everything similar to my GParted version. Only I deleted .iso from its name. The folder is empty. Then I opened WinImage tool. From the "File" menu item "Open" command, I opened the GParted.iso. All files and folders inside the image appears in explorer frame and navigation pane of WinImage. I notice that the CD image includes isolinux but GParted.zip for hard disk included syslinux as it is obvious from their application. Isolinux puts an ISO image of a CD on the memory, syslinux puts the image from a hard disk on the physical memory. Then I go to "Image" menu item "Extract" command and brows to GParted empty folder I have created in "My Documents" to extract all files and folders of ISO CD in this folder. Now contents of ISO are accessible for adding new items. I added "unzip" file to the root of folder to use it later on my "Debian" command line for unzipping GParted.zip. I also added file GParted.zip to the root. Now I can reconstruct the folder back to a new ISO image of mine, using free "ImgBurn: Image Burn" utility as I explain in the next post.
Update, 25 February 2014 : You might find these two wikis useful, too.
They include images and are step-by-step. Moreover, they are more recent than this post.
Note that in Windows 8/8.1 you do not need a virtual drive. Just right click on an ISO image, select "Open with" from the context menu and then from  the secondary menu, choose "Windows Explorer" to open the file. Windows promptly creates a Virtual DVD drives and opens ISO inside that drive. Please, "eject" that drive after finishing working with the ISO to release your resources. Nevertheless, you need to copy files from that location to other locations to be able to manipulate them. ISO images are "read-only" files.


Wednesday, 13 May 2009

Using Virtual Drives

You see, for so many tests I can't burn Cd's and DVDs and then revise my things and throw those out and burn new items. I make everything virtual. I have Daemon Tools from here . There are numerous similar free software for this purpose. With Daemon Tools you can setup virtual DVD drives without actually having need to a hardware. You can put an ISO image on these virtual drives and test it. When I am installing these tools always I am vigilant to custom install them, and to prevent installing items that later might become annoying for me. I do not like having shortcut icons on my desktops and loading memory and CPU with quick launch processes.

Sunday, 10 May 2009

GParted Has Commandline Linux

I always had two floppies of Basic Linux 3 to work on command line Linux. Now by permanent installing of GParted I have a more powerful tools. In due time I write what should be added to these tools to make them more ideal. For that reason I selected a more relax space for GParted. I also couldn't use the tools available in this minimalist Debian to unzip GParted.zip downloaded for installing on hard disk. Gunzip and Zcat give "more than one entry point" error. They cannot decompress Gzipped by "7Z" either. Curtis Gedak from GParted kindly instructed me, by private communication, that to use good old free "Zip" and "Unzip" from here. I selected "unz550x-glibc.zip" from the list. From the unzipped folder I only need to have the file "unzip," some hundred kilo bytes. Other pieces could be useful but not right now.Later I should inject this to GParted CD iso image that I have together with other things.

Saturday, 9 May 2009

Installing GParted on a Hard Disk Partition

A good drill is to put GParted in some Linux partition flavours. If you can force different operating systems and different partitioning schemes coexist or even symbiosis together and you can do it when you are young then later you can force your dog to sleep on the floor instead of on your bed. Hence, my goal becomes to put XOSL and GParted inside an extended partition and have other operating systems in primary partitions. I am interested in using XOSL as the start menu. One bad thing about XOSL is that you are limited to its GUI. There s no way to edit some script to hack things over it. It is another project to search inside its source documents and find things. It has its own dedicated partitioning system with partition type=78 hex. I still have not tested a second version, XOSL2 (Return of XOSL?). But it has many good things such as destroying booting trace of installed operating systems and taking all activities in its own hands. That eliminate need of editing boot loaders of other operating systems. They do not become aware of each other activation and believe that each one of them is the default active operating system. That encouraged me to work with XOSL until I become convinced that it is becoming obsolete and I need to replace it with some new device such as GRUB or GRUB2 and I am still puzzled with GRUB super CD. You notice that I mean GNU and free software. Otherwise, if one pays he can get consultants come and sort things for his computer. Let me tell you what happened next. I reformatted my extended partition (already I called it "Lab" partition) as again 24Mb of FAT16 logical partition for XOSL and a 300Mb logical for GParted with "ex2" partition type. I left this space bigger than required 120Mb because I want to do some other experiment later. I used GParted latest CD to do that. Gparted includes a command line Linux "Debian" flavour, which is crammed with desired tools for experimenting Unix type of operating systems.