OSDev.org
https://forum.osdev.org/

Storing data in Operating System
https://forum.osdev.org/viewtopic.php?f=1&t=32565
Page 1 of 1

Author:  Fathergorgi1 [ Mon Nov 13, 2017 7:13 pm ]
Post subject:  Storing data in Operating System

Hello! I am creating a custom operating system and is there any way to store data (almost like a filesystem) in assembly so that if the computer shuts off and turns back on the data will still be there?

Author:  iansjack [ Tue Nov 14, 2017 12:37 am ]
Post subject:  Re: Storing data in Operating System

Yes.

You write a driver for your storage medium and then implement a filesystem handler in your OS. It's easier, when starting out, to use an existing filesystem rather than designing your own.

It's much easier to do this using a high-level language such as C rather than assembler.

Author:  Schol-R-LEA [ Thu Nov 16, 2017 10:52 am ]
Post subject:  Re: Storing data in Operating System

Fathergorgi1 wrote:
Hello! I am creating a custom operating system and is there any way to store data (almost like a filesystem) in assembly so that if the computer shuts off and turns back on the data will still be there?


As iansjack sort of hinted at, something like this would be, in effect, a rump file system, albeit one with a very rudimentary and fixed format (though 'data storage system' might fit better here, since there would really be no 'files' per se).

Just how you'd do this is going to depend on why you want to do this, and what you want it use it for. Could you give more details on your intentions? I am assuming that there's a reason why you don't want to write a file system driver and use the file system for it, at least at this stage - and there are a number of reasons you might not want to, either early in the project or for some specific need of the system over the long term - and knowing more about that reason would help us give you better advice.

I am particularly concerned because this sounds like it might be an XY Problem (or, as Alex Papadimoulis called it, an 'old shoe or bottle' problem). This kind of fixation on a specific solution rather than on the problem itself is a trap pretty much every programmer falls into at one time or another (I certainly have, more than once), and it is usually something that you don't see until someone else points it out. Unfortunately, the trouble lies in asking a question about the expected solution rather than the actual problem - it is a form of the logical fallacy of 'begging the question', in that you are assuming a specific solution rather than trying to find alternative answers.

I am not saying that this is the case here, but it sounds like it might be, and we'd need to know more of the context of the question to be sure.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/