how to create an installer for operating system?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

how to create an installer for operating system?

Post 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
testing the operating system is very hard when your eyes can't see well
like me and many others
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: how to create an installer for operating system?

Post by Love4Boobies »

Load what from BIOS?

Anyway, questions like "How do I write X?" are too open-ended to be answered.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

Re: how to create an installer for operating system?

Post 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?
testing the operating system is very hard when your eyes can't see well
like me and many others
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: how to create an installer for operating system?

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

Re: how to create an installer for operating system?

Post 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
testing the operating system is very hard when your eyes can't see well
like me and many others
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: how to create an installer for operating system?

Post by FallenAvatar »

An OS Installer is basically just a small "single purpose" operating system. So.... go read the wiki.

- Monk
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: how to create an installer for operating system?

Post 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..
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
h0bby1
Member
Member
Posts: 240
Joined: Wed Aug 21, 2013 7:08 am

Re: how to create an installer for operating system?

Post 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
brighteningeyes
Member
Member
Posts: 45
Joined: Sat Sep 07, 2013 8:26 am
Contact:

Re: how to create an installer for operating system?

Post by brighteningeyes »

thanks a lot
testing the operating system is very hard when your eyes can't see well
like me and many others
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: how to create an installer for operating system?

Post 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.
h0bby1
Member
Member
Posts: 240
Joined: Wed Aug 21, 2013 7:08 am

Re: how to create an installer for operating system?

Post 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
Post Reply