OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 6:46 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Advantages and disadvantages over disk emulation modes
PostPosted: Sat Jan 12, 2019 3:44 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
Hi, again.

As I was thinking about designing my ISO image boot loader, I was contemplating about what the advantages and disadvantages are over the different disk emulation modes.

I am very serious about doing the best job that I can at building my little hobby OS, and would like to know if anyone knows any advantages or disadvantages over using any of these mentioned emulation modes. I am tempted to use floppy-disk emulation, since it might be simpler to use. This is for the optical-disk image files, not anything that goes on an actually storage disk that you would general use for long term storage of an operating system.

If anyone has any input, I would highly appreciate it!

Anyway, kind regards.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sat Jan 12, 2019 8:30 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
After many, many hours of consideration, I have decided to go with floppy-disk emulation as the disk-emulation mode, but I am still looking for opinions, if anyone has any!


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 12:52 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
Just write a UEFI boot loader. That's the future, anyway.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 3:17 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Don't use emulation.

With floppy disk or hard disk emulation, you can only access the contents of the disk image using the BIOS. In no-emulation mode, you have access to the entire contents of the CD. It also simplifies creation of your ISO, since you don't need to create another disk image and embed it into the ISO.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 3:40 am 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
Octocontrabass wrote:
Don't use emulation.

With floppy disk or hard disk emulation, you can only access the contents of the disk image using the BIOS. In no-emulation mode, you have access to the entire contents of the CD. It also simplifies creation of your ISO, since you don't need to create another disk image and embed it into the ISO.


Until you get to EFI and need to embed a FAT in the CD again for that...

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 12:42 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
nullplan wrote:
Just write a UEFI boot loader. That's the future, anyway.


Oh, I definitely will, eventually! This one, though, I want to experiment with the traditional BIOS first.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 12:44 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
Octocontrabass wrote:
Don't use emulation.

With floppy disk or hard disk emulation, you can only access the contents of the disk image using the BIOS. In no-emulation mode, you have access to the entire contents of the CD. It also simplifies creation of your ISO, since you don't need to create another disk image and embed it into the ISO.


Disk emulation almost seems a little bit more secure than just straight up off the disk. I could be entirely wrong, and it might just be me, but emulation intrigues me for some reason.

I have also tried thousands upon thousands of different times to get no emulation to work, and I cannot get it to work. So I am seeing if this will work out for me, lol


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 2:25 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
saltlamp wrote:
Disk emulation almost seems a little bit more secure than just straight up off the disk. I could be entirely wrong, and it might just be me, but emulation intrigues me for some reason.

Secure how? There are only a handful of very old computers that can boot a CD in floppy disk emulation mode but can't boot a CD in no-emulation mode.

saltlamp wrote:
I have also tried thousands upon thousands of different times to get no emulation to work, and I cannot get it to work. So I am seeing if this will work out for me, lol

If you're still interested in making it work, you can post here. Someone might be able to spot the problem.

klange wrote:
Until you get to EFI and need to embed a FAT in the CD again for that...

I forgot about that. I wonder if there are any mkisofs-style tools that could generate the FAT32 filesystem as a wrapper around the disc's contents, similar to how ISO9660 and UDF can be combined in the same disc.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 4:40 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
Octocontrabass wrote:
Secure how? There are only a handful of very old computers that can boot a CD in floppy disk emulation mode but can't boot a CD in no-emulation mode.


What I mean by 'more secure' is in a data-access kind of way. With emulation, it's almost as though the actually functionality of the CD/DVD is in a sort of 'purgatory,' and any program or code on the emulated-disk that wants to access data on the real disk has to go through the emulated disk via a driver of some sorts. This also stops rogue programs on a CD/DVD from executing, since the functionality to execute a program is all in the emulated disk in the first place. No program can start, unless started by the emulated disk.

Say that you have a driver that you write, and it only recognizes specific files on the disk that are needed to install your system or run the disk, and it only allows execution of those specific files or programs. If you put random files or executables on the same disk, they won't be recognized as important system files, and therefore will not be allowed to run. You might most likely will have to sign the files in some way, shape, or form, so that they are only recognized.

This could also help against viruses or malicious attempts to create look-a-likes and just implant them into the disk. And I do understand that malicious people could decompile and disassemble them and see what they signatures they have, but you get the point. It could even just help in random programs being executed for whatever reason, although it is unlikely. It's still a precaution, since it has the chance, even though it's low, to screw something up while installing or whatever.

Obviously it's not really that much different in the long run, because you could easily implement this kind of program guard your self without emulation, but there is that little extra layer of accessibility measures, and it could prove to be useful in some way, shape, or form. If if it's hard-disk drive emulation, because floppy-disk emulation is probably going to not exist for much longer, since computers are advancing so quickly.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 4:44 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
Octocontrabass wrote:
Quote:
If you're still interested in making it work, you can post here. Someone might be able to spot the problem.


Well, the main problem is that Mkisofs (the tool which I was using) would always complain with this message,

"Uh oh, I cant the boot image '...' !"

And I kept doing every single directory-path combination that I could try, even ones that made no sense, because I learned that Mkisofs works with relative-paths for whatever reason. And it was just super aggravating.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 6:44 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
saltlamp wrote:
What I mean by 'more secure' is in a data-access kind of way.

In that case, there's nothing about floppy disk emulation that makes it more secure. You still have to read files off the CD one way or another - if a malicious program is on the CD, it will be your code that reads it, and your code that decides whether it should run or not.

saltlamp wrote:
Well, the main problem is that Mkisofs (the tool which I was using) would always complain with this message,

"Uh oh, I cant the boot image '...' !"

Changing to floppy disk emulation won't make a difference here. What commands are you using to invoke mkisofs? Where are the files you want to put in the ISO located?


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Sun Jan 13, 2019 7:37 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 11, 2018 3:13 pm
Posts: 50
Octocontrabass wrote:
Changing to floppy disk emulation won't make a difference here. What commands are you using to invoke mkisofs? Where are the files you want to put in the ISO located?


No, lol, I was trying to do that without emulation. I have just recently begun trying to do floppy-disk emulation, but I could not get no-emulation to work at all.

When I was doing the whole no-emulation thing, it was like this,

I had have a directory called 'media' under my project root directory. This directory contains the following directories:

boot
image
out

where 'boot' is the file, or files, used for the disk's start-up code (zeroth-sector .bin files, etc),
'image' is the contains that go on the disk image, and 'out' is where, once completed, all finished items get deposited.

I had a Makefile under 'boot' that is invoked via
Code:
$(MAKE) -C
in the previous directory. The command that I was using is the following:
Code:
mkisofs -b ../boot/<.bin> -hide <.bin> -V <volume label> -iso-level 3 -no-emul-boot


Mkisofs is supposedly path-relative; relative to the directory that you are trying to output the resulting .iso file. So I was being as relative as flippin' possible. I've tried too many path combinations to even mention.


Top
 Profile  
 
 Post subject: Re: Advantages and disadvantages over disk emulation modes
PostPosted: Mon Jan 14, 2019 5:54 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
You're telling mkisofs to use a file that isn't on the CD as the boot file. You need to include your boot file on the CD.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 57 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group