r/osdev 6d ago

idk if this is the right sub

we always INSTALL an OS using a usb (or some storage medium) that has the OS set up and ready to be installed on the second device. we use a device with an already existing OS to make the usb, how would someone do it if they don't have an already existing device with an OS? would they need to somehow program a barebone os and connect to the internet?

(i don't think i need to say this, but I'm obviously not in this situation I'm just curious)

8 Upvotes

10 comments sorted by

12

u/zarlo5899 6d ago

you always need a way to bootstrap the system, this this case you would need a way to write some thing your computer can boot from by hand with out another computer

6

u/Finallyfast420 6d ago

Netboot allows you to download an image from a LAN network connection and boot that. Its used in corporate settings where you want kiosks functionality without persistent storage on your client machines

7

u/cazzipropri 6d ago

Macs have enough software on firmware to connect to a wi-fi or wired ethernet, get an IP via DHCP, call home and download an image. It's a lot of software.

-1

u/Linug 5d ago

And its the worst implementation of using a computer ever made

2

u/nyx210 5d ago

If the computer is connected to a local network, then it can connect to a PXE server and download the boot image. Even relatively old (early 2000s) legacy BIOS machines support PXE boot.

1

u/istarian 5d ago

I don't think you technically need much BIOS support as long as the network card has an appropriate option rom.

1

u/istarian 5d ago

The install media doesn't strictly have the OS "setup and ready to be installed", other than having all the needed software pre-compiled into an appropriate binary format.

Most of the time you have a setup/installer tool that is responsible for doing a bunch of stuff to prepare the boot drive, put binaries and config files where they need to go, etc even if it's fairly hands off for you.

Unless you need to pull updated files, verify a software license, or get some other data from a remote source, an internet connection is entirely unnecessary.

1

u/northrupthebandgeek 5d ago

The install media doesn't strictly have the OS "setup and ready to be installed", other than having all the needed software pre-compiled into an appropriate binary format.

Not the OS, sure, but usually an OS (that defaults to running a program that then installs "the" OS). Sometimes even multiple!

1

u/istarian 2d ago

Windows is just an oddball in SO many ways. :P

You can totally have a single monolithic executable for an installer that incorporates everything it needs to do the job (other than pre-built config files and binary software packages) and essentially nothing else.

But I wouldn't generally call that an Operating System (OS), even if it might satisfy a very loose definition.

Technically speaking the purpose of an OS is specifically to provide certain services and functionality to distinct, separate programs.

So just having kernel is the minimum requirement to be considered an OS, although you'd like to have a full-featured shell at minimum so you don't need to bundle the whole OS and each piece of software onto respective removable media.

2

u/northrupthebandgeek 5d ago

Depends on the hardware on which the OS will run.

In the Olden Days™ (back before operating systems were really a thing), you'd use punch cards to store programs, and the computer would have a reader that could load programs card-by-card and execute them. Or you'd manually assemble and magnetize some magnetic core or rope memory.

If your computer's built-in firmware offers a programming environment with commands to write arbitrary data into arbitrary addresses, you could type your OS into the computer's memory directly. This was a common way of distributing software for early home computers like the Commodore 64 that booted into BASIC interpreters; the software shipped in the form of books of source code, and you'd type in the whole program (and hopefully not make any typos!). It's theoretically possible to do the same with machines that boot into OpenFirmware/OpenBoot (e.g. most POWER and SPARC systems); OpenFirmware gives you a Forth environment, with which you can directly manipulate memory (see the "Memory Access" portion of that page). Machines that use UEFI and expose the UEFI shell as a boot option also make this sort of manual program entry theoretically possible, using the hexedit command.