OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 6:01 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Sat May 28, 2016 12:02 pm 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
I am frankly getting quite frustrated at everyone's continual refusal to spell out exactly what they mean. Clearly everyone has something in mind when they post, but instead of actually saying what they mean they think it's a funny game to drop little "hints" at what they're thinking of.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Sun May 29, 2016 3:57 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Could you tell us what you mean by that comment, citing the posts that you are referring to, rather than playing games and dropping little hints about people refusing to spell out what they mean.


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Sun May 29, 2016 5:31 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
onlyonemac wrote:
I am frankly getting quite frustrated at everyone's continual refusal to spell out exactly what they mean.

Does everyone include you?

There can be simplified algorithms that are able to verify something. If it's about the x86 code then there are such tricky areas as pointer arithmetic and hardware interaction. If we consider a code without pointer arithmetic and hardware interaction then it is obvious that now we have to spend less efforts on checking it. What kind of code to accept is a design time decision, but as pointed above it can greatly influence the complexity of the security related checks. That's why there are OS projects with a specific kind of code usually called bytecode. Besides of the pointers and hardware the bytecode enforces the conversion step after an OS has given a code. Such step is convenient because it reminds the developer about the input verification and allows to optimize the conversion result for it to match the actually present hardware. But from the other side such approach requires more time to be spent on development.

_________________
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Mon May 30, 2016 2:16 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
embryo2 wrote:
onlyonemac wrote:
I am frankly getting quite frustrated at everyone's continual refusal to spell out exactly what they mean.

Does everyone include you?
My original statement was that there is no way for an OS enforce the use of a memory-safe programming language. The first response I received was "sure there is", claiming that this is "easily possible" without naming a single way of doing this. I suggested bytecode (guessing at what the previous response was meaning), to which I was told "running everything under wise management" and "bytecode is just a small bit of the picture", again without actually telling me what wise management and what bigger picture the poster had in mind.

If this isn't "dropping hints" then I don't know what is.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Mon May 30, 2016 8:52 am 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
The original poster went on to describe what they had in mind; all the confusion came from other posters bringing in their own, different, ideas. :|

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Mon May 30, 2016 11:35 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
Rusky wrote:
The original poster went on to describe what they had in mind; all the confusion came from other posters bringing in their own, different, ideas. :|
You didn't describe what you meant by "verify", what formats you considered this to be possible with, and how you consider it to be possible with those formats.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Mon May 30, 2016 2:43 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
I didn't figure it was necessary- there are plenty of systems that already solve the problem in various ways, and many more that solve parts of the problem. But so you don't think I'm being mysterious again, I'll elaborate.

To verify a program is memory safe you need to ensure that it never access memory it does not own. This is an extremely well-solved problem- most languages in use today accomplish it, and you even brought one up as an example. VM languages like Java or C#, scripting languages like Javascript or Python, statically verified languages like the safe subset of Rust, etc.

Then, in order for the OS to verify it, it needs to accept applications only in some form that still retains the necessary information for that analysis, of which I already listed several examples- source, AST, CFG, bytecode, etc.) This has also been done to death- browsers do it, Android does it, research OSes based on Java and C# do it, etc.

Like I said from the start, it's a tradeoff: you give up the flexibility of distributing apps in any format you like, and gain the ability for the OS to control exactly what code is allowed to run. You can run that code however you like- whether you interpret it or JIT-compile it or generate machine code on installation, the OS is still in control.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Mon May 30, 2016 11:59 pm 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
Rusky wrote:
I didn't figure it was necessary- there are plenty of systems that already solve the problem in various ways, and many more that solve parts of the problem. But so you don't think I'm being mysterious again, I'll elaborate.

To verify a program is memory safe you need to ensure that it never access memory it does not own. This is an extremely well-solved problem- most languages in use today accomplish it, and you even brought one up as an example. VM languages like Java or C#, scripting languages like Javascript or Python, statically verified languages like the safe subset of Rust, etc.

Then, in order for the OS to verify it, it needs to accept applications only in some form that still retains the necessary information for that analysis, of which I already listed several examples- source, AST, CFG, bytecode, etc.) This has also been done to death- browsers do it, Android does it, research OSes based on Java and C# do it, etc.

Like I said from the start, it's a tradeoff: you give up the flexibility of distributing apps in any format you like, and gain the ability for the OS to control exactly what code is allowed to run. You can run that code however you like- whether you interpret it or JIT-compile it or generate machine code on installation, the OS is still in control.
Thanks, that makes a lot more sense. :-) :-) :-)

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 36 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