What type of file is an operating system?

What type of file is an operating system?

I've been looking up information about operating systems lately, and have yet to find an answer to this question. What type of file is an operating system? Would it be an application(.exe), some kind of source file (like .c or .cpp) or something else?

Stated a little differently, because operating systems can be booted off of SD cards and flash drives, what type of file would you save into the removable device that it would use?

Thanks

-Zach

答案1

An operating system isn't exactly one file type, it is made up of tons of different file types working together to create something bigger. It sounds like you are looking to be able to boot into an Operating System from a flash drive, in which case, you might be looking for an .iso file that can be made bootable.

If you're attempting to boot into a Windows platform via USB, you need to obtain an .ISO file online or directly from a CD/DVD. Keep in mind you will need a valid Product Key in order to install the OS.

Here is a little more detail and guide on creating a bootable flash drive for Windows: http://arstechnica.com/business/2009/12/the-usb-flash-drive/

Here is more details / guides on Ubuntu (linux) bootable flash drives: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows

答案2

Differs per operating system, if you mean the single file that's the actual running kernel, which of course doesn't do much without assistance from many, many files.

The actual DOS operating system was housed in two hidden files on the root of the boot volume or floppy, IO.SYS and MSDOS.SYS (or IBMBIO.SYS and IBMDOS.SYS on PC-DOS). I don't think these have an header or anything, i.e. the bootloader loads the files and then jumps to the first location where it loaded them.

ntoskrnl.exe and friends such as ntkrnlpa.exe are in Windows PE format, so they look like a standard executable. There are different types of .exe's, and I believe it'd be a "native mode" executable and not runnable while you are in a Win32 session, as 99% of time you are when you are running Windows. The full Windows OS and API is generally a collection of well-known .DLLs (ntdll.dll and others), though, so ntoskrnl.exe hardly does most of the work of running the system on its own.

Linux is generally a single binary image entitled vmlinuz or similar. Typically you'll also have an initrd which is the filesystem that the kernel has at boot time - but this is optional. I'm unsure of it's format but it's not an executable. The bootloader is meant to jump to the start of this image directly after loading it in memory.

相关内容