Page 1 of 1

how to create an installer for operating system?

Posted: Sat Sep 07, 2013 8:57 am
by brighteningeyes
hi all!
i'm writing an OS:
i have a question:
how can i create an installer for my OS that can load it from bios?
i'm using GCC 4.7 in cygwin and grub as my bootloader

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 10:54 am
by Love4Boobies
Load what from BIOS?

Anyway, questions like "How do I write X?" are too open-ended to be answered.

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 1:52 pm
by brighteningeyes
my mean is:
i have an os and wanted to write a installer for it that can be loaded from bios
how to write a installer for an os that can be loaded from bios and install's the os?
like windows, linux and more?

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 4:56 pm
by Love4Boobies
They aren't loaded from BIOS. I did understand what you meant by that but I don't think you do.

Anyway, as I've said, the question is too open-ended. The short answer is: "You'd write one using your keyboard." First of all, ask yourslef what you want your installer to do. Break it down to a list of requirements. Then, figure out which of those requirements you don't know how to satisfy and ask more specific questions here.

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 9:19 pm
by brighteningeyes
these are the requirements:
firstly, it load's from bios, ask from user where you want to install, then copy's the bootloader, kernel, and load's and show the wellcome message

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 10:13 pm
by FallenAvatar
An OS Installer is basically just a small "single purpose" operating system. So.... go read the wiki.

- Monk

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 11:26 pm
by Brynet-Inc
An installer might very well be a modified version of your OS that boots into a RAM disk environment containing a shell script and a few specially chosen utilities.

You already have a kernel and a userland, it doesn't require much of an imagination to decide where to go from there..

Re: how to create an installer for operating system?

Posted: Sat Sep 07, 2013 11:41 pm
by h0bby1
the thing you need to determine is

1.- the media on which the data will reside (i guess cd rom or usb otherwise if they already on the hard drive you don't need to install it)
2.- the format of the source data to be installed, and how to determine what there is to be installed
3.- where it need to be installed
4.- how to configure boot loader on the target system to make your installed os bootable

basically the first thing you'd need to do is to create an image where the file to be installed will reside, probably a cdrom or an iso, or network source or other

then you need to make an 'installer bootloader' and the installer program that will be loaded by this bootloader to run the install

the install program can i guess be run in 16 bits real mode if you use bios function to manipulate the storage devices (hd, cd rom, usb stick)

the installer program need to figure out where the source file reside, if it's on a file system, it need to be able to find, open and read the file system on which the files to be copied reside, if it's more on the line of compressed archive, image, or other format , packages or other, the installer system need to be able to find them on the source media and to figure out what need to be copied/installed/configured for the target system

then it need to identity the target filesystem, either it require that a partition already exists somewhere on the system to copy the files to, or it need to incorporate a partition editing software to create a partition for the os to be installed on

then it need to copy the file from the source data to this filesystem

then configure a bootloader, either totally overwriting the mbr, but if any other os already use the mbr for it's own boot loader, it won't be able to boot unless you handle a multi boot system in your own mbr to be able to load other os, either you need to deal with the already installed bootloader, either grub, lilo, or the windows bootloader (file boot.ini at the root of windows partition), and configure the boot loader to load your kernel and whatever else the kernel need to be loaded to boot

then normally it should be done

if you want to make an installer that run from another os, it might be simpler, and then you just need to basically put the file somewhere and configure the bootloader, it only need step 3 and 4, if it's from unix, you need to use the already installed bootloader present on the system, if it's from windows you need to use the boot.ini file, on other os like macos i don't know how you can configure the boot loader

Re: how to create an installer for operating system?

Posted: Sun Sep 08, 2013 1:23 am
by brighteningeyes
thanks a lot

Re: how to create an installer for operating system?

Posted: Sun Sep 08, 2013 2:21 am
by bluemoon
You may also write your installer to run on any OS you like. For example, BeOS and some Linux ship with Installer that runs on Windows.

If you have already got an OS, I suppose you got the idea what an installer should do.

Re: how to create an installer for operating system?

Posted: Sun Sep 08, 2013 2:31 am
by h0bby1
bluemoon wrote:You may also write your installer to run on any OS you like. For example, BeOS and some Linux ship with Installer that runs on Windows.

If you have already got an OS, I suppose you got the idea what an installer should do.
yes it can be done, but then need to maintain a version of it for each os you want to install from, and it can make it hard to access some ressource as well if you need to have some information on the hardware in order to install specific thing or specific version of some files for some specific arch, all the detection routine and installation process have to be coded and maintained for each os from which you want to install, including tool for partitionning if one is needed etc it can be also a burden, or can be simpler if you don't need much hardware detection and the code to handle target partition and file system and install files is portable enougth