Closed Beta Discussion: Block devices

Block devices
Alphadon
Oct. 3, 2016, 4:36 p.m.

A question: Will the first sector have room for a partition table, as in real life? Or will we need the second one for that. Also, an idea: Make the Hacker's Edge BIOS an in-game program stored on a normally inaccessible ROM chip (block device). This way, something similar to EFI (Which is how all PCs made after 2014 function, by the way) can be made, allowing much more complex pre-boot environments. The BIOS will be burned on to this chip at manufacture time by someone owning an in-game computer company. Does it sound like a good idea?

P.S. I broke my Linux installation with a package manager error yesterday and accidentally erased Windows as well in the reinstall process. As such, I may be slightly irritable in-game. Pay no attention to that.


Block devices
kveroneau(Game Creator)
Oct. 3, 2016, 5:50 p.m.

The block devices are entirely free form, how the block device is used comes down to the file system driver you use. The initial file system will be basic and won't do anything special like partition tables. Once players start creating their own OSes, players can use the block device however they like, including the creation of partition table aware OSes. Both MBR and the newer GPT in x86 aren't driven by the BIOS, OSes like Windows, Linux, and OS X create and read the disk structure you know as a partition table. Both MBR, and now GPT are agreed industry standards which OS developers follow and integrate.

As for the booting, the original x86 standard of using the first 256 bytes as a boot block will exist in Hacker's Edge. As Hacker's Edge evolves, I may introduce more modern concepts. I am starting at the 6502 for several reasons, as it gives the game a lot to grow on in terms of how real world technology has grown in the past few decades. Depending on the popularity of Hacker's Edge, this game world will also evolve and constantly introduce new technologies into the mix. :). I am hoping to have more than one computer architecture eventually.


Block devices
Alphadon
Oct. 4, 2016, 4:27 a.m.

Would it even be possible for players to design their own hardware in the far future of the game?


Block devices
kveroneau(Game Creator)
Oct. 4, 2016, 5:21 a.m.

I'm not entirely sure how to enable players to design hardware. The emulated hardware is currently written in Python. While it shouldn't be impossible to create a layer of sorts to allow custom hardware specifications, I'm not sure what type of custom hardware players would require.

What type of player created hardware devices were you thinking of exactly?


Block devices
Alphadon
Oct. 4, 2016, 5:34 a.m.

Well, I was thinking of player-created expansion cards for such things as graphics, as well as custom processor architectures. I would like to note that this HAS been done. See my post in Ideas/Suggestions for details.


Block devices
Alphadon
Oct. 4, 2016, 9:57 a.m.

Oh, and by the way, about GPT, you have it a bit wrong. The EFI firmware chip will load, based on the GPT partition table occupying sector 1, a master boot partition, containing a bootloader in the form of .efi files. So yes, GPT is driven by the BIOS equivalent. MBR, on the other hand, is also not OS-driven, but rather driven by a partition table on the hard disk and the boot code in the first sector. Just wanted to clear that up!

P.S. BIOS and EFI are two different things. EFI replaces BIOS.


Block devices
kveroneau(Game Creator)
Oct. 4, 2016, 6:13 p.m.

Yes, EFI is dependent on having a GPT partition layout on hard discs, as there needs to be a special boot partition. I have always imagined EFI as GRUB(or any OS bootloader) stored directly in firmware, as in both cases, they don't load in sectors, but a boot file. In GRUBs case, the Linux kernel, and in EFI, an EFI binary file. Technically, the EFI binary header can be attached to a Linux kernel to boot the kernel directly from EFI(eg. Vmlinuz.efi)

If you think of the current Hacker's Edge, where a BOOT.SYS is loaded, it's more similar to EFI than the new block device being introduced. EFI loads a boot file from disc, over a disc sector.

I may eventually open up a pre-boot environment, where boot code is run from ROM which can be set per machine type.

I am aiming to have Hacker's Edge follow a natural hardware evolution once it's live, as this will keep things interesting and gives players a reason to return and explore new things. So rest assured that EFI will be introduced eventually. :)

Player expansion cards like graphics don't entirely fit. At least at the moment there's no system to display said graphics, and telnet can't launch external GUI windows to provide that ability. If you think of emulators like DosBox and virtualization like VirtualBox, they only emulate existing graphics cards for the purpose of making it compatible with existing OSes. VMWare did create it's own video driver to enable features like 3D accelerated graphics. For graphics expansion type cards, it would be more of a client-side application mod. I do plan on eventually making an official client, and at that time I may consider allowing it to be easily modded to add additional client side capabilities, like graphics cards. Custom hardware will really add lots of complexity, and players needing to actually write driver software to control said hardware.

EFI is still supports legacy BIOS in most machines still. If you enter the OEMs boot screen on EFI systems, you can still boot using legacy BIOS. BIOS booting is still widely available on EFI machines. GPT is also not a requirement when booting either USB or DVDs, all these devices need is a /efi/BOOT directory with a compatible EFI binary file to boot. EFI technically doesn't require GPT, but EFI is fully aware of GPT. If you download a Linux distribution ISO or bootable USB image, you won't see GPT, but an EFI boot structure on either ISO9660 or MBR scheme. These images will also most likely come with the legacy boot methods of El Torito or MBR boot sector for compatibility with all systems. I don't believe that legacy BIOS can boot GPT partitions, as legacy BIOS needs a boot sector. However, BIOS isn't dependant on any partitioning scheme, it's the responsibility of the boot sector code. The MBR boot code checks the MBR partition table for the active partition, loads the first sector of said partition and executes it.

Technically once block devices are rolled out, you can emulate what EFI does without a firmware. Create a new small block device which you can call ROM. Have this as the first block device as read-only. The second block device would have a GPT partition table and no boot sector. Your EFI ROM block device will load first and check the partition table on your GPT block device, and allow you to select which .efi file to boot on that disc. This has actually been done to allow non-EFI machines to boot EFI. It's widely used in the Hackintosh community as OS X requires EFI to boot. The EFI boot code for BIOS-based systems is called XPC EFI Bootloader, which uses EFI developer tool called DUET to boot EFI from MBR boot code.