COM executables

Feb 16, 2012 at 12:26 PM
Edited Feb 16, 2012 at 12:27 PM

Any idea how we could run COM executables? I think they're quite easy to implement, as they are raw binaries and they don't have any dependencies really, do they :)? I think it's just a job of loading the file into memory and calling it from assembly.

-Aurora

Coordinator
Feb 16, 2012 at 12:30 PM
COM assumes interrupts i think?


On Thu, Feb 16, 2012 at 2:27 PM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

Any idea how we could run COM executables? I think they're quite easy to implement, as they are raw binaries and they don't have any dependencies really do they? I think it's just load the file into memory and call it from assembly.

-Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 16, 2012 at 12:36 PM
Edited Feb 16, 2012 at 12:38 PM

OSDev doesn't say anything about interrupts, but it does say this:

COM files were used by MS-DOS. They are raw binaries--there is no header data. Also, COM files are restricted to the size of one segment (a real-address mode segment, 64kb), minus 256 bytes. When a COM file is loaded, it is assumed that all code and data fits in one segment, and it is loaded to offset 0x100.

 

Plus, we use interrupts, don't we?

-Aurora

Coordinator
Feb 16, 2012 at 12:38 PM
i think it assumes interrupts etc..


On Thu, Feb 16, 2012 at 2:36 PM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

OSDev doesn't say anything about interrupts, but it does say this:

COM files were used by MS-DOS. They are raw binaries--there is no header data. Also, COM files are restricted to the size of one segment (a real-address mode segment, 64kb), minus 256 bytes. When a COM file is loaded, it is assumed that all code and data fits in one segment, and it is loaded to offset 0x100.

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 16, 2012 at 12:43 PM

As I say, we use interrupts anyway, don't we? If we don't, I think I need to reread OSDev :|.

Feb 16, 2012 at 4:02 PM
Edited Feb 16, 2012 at 4:08 PM

My question is how do you load it into memory? After that, one line of code is needed: call main

Is it just a case of allocating 64k of memory and copying the file contents into it? -Aurora

Coordinator
Feb 17, 2012 at 6:58 AM
but how would that com communicate with cosmos? if not necessary, just skip out cosmos and go for COM-based kernel (syslinux allows you to do this)

On Thu, Feb 16, 2012 at 6:02 PM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

My question is how do you load it into memory? After that, one line of code is needed: call main

-Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 7:26 AM

It would help to communicate with cosmos, but a first step would be to just load them.

-Aurora

Coordinator
Feb 17, 2012 at 7:30 AM
you'll need to make that yourself, which is going to be hard: you have to make sure that the COM is loaded at the memory location it assumes (hard, because we have a specific loading location, and then the memory allocator starts after that), and then you need to make a JUMP/CALL statement to the start address (also not too easy)
But why you want COM executables loaded in cosmos? whole point of cosmos is not using unmanaged stuff...


On Fri, Feb 17, 2012 at 9:26 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

It would help to communicate with cosmos, but a first step would be to just load them.

-Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 8:16 AM

Well, you could adjust IL2CPU for a seperate binary, and set nasm to flat binary, and you get a com executable, and you just create a pointer to the address, then use X# to call it, don't you?

Coordinator
Feb 17, 2012 at 8:19 AM
yes, but then you have two kernels fighting. dynamic loading is more complicated than this... the processes need to be able to communicate (ie, kernel sets up networking, process uses this, etc)

On Fri, Feb 17, 2012 at 10:17 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

Well, you could adjust IL2CPU for a seperate binary, and set nasm to flat binary, and you get a com executable, and you just create a pointer to the address, then use X# to call it, don't you?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 8:29 AM

True, but just make IL2CPU run a function once then pass a ret instruction. I do agree that we need some inter-process communication

Coordinator
Feb 17, 2012 at 8:35 AM
besides the practical fact: this needs lots of changes all over..
What's your goal with this?

On Fri, Feb 17, 2012 at 10:29 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

True, but just make IL2CPU run a function once then pass a ret instruction. I do agree that we need some inter-process communication

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 8:50 AM
Edited Feb 17, 2012 at 8:50 AM

My goal mainly is just to load executables, I don't really care about multitasking yet, just single tasking. I think we first need syscalls, then pipes or some IPC, then executables should be relatively simple. -Aurora

Coordinator
Feb 17, 2012 at 8:52 AM
but the things you mention are huge. what is your goal? what kind of executables? what's the source of those executables? all written by same project? then just go with embedded in same project and method calls


On Fri, Feb 17, 2012 at 10:50 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

My goal mainly is just to load executables, I don't really care about multitasking yet, just single tasking. I think we first need syscalls, then pipes or some IPC, yhen executables should be relatively simple. -Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 9:25 AM

Well, I like the idea of Cosmos, so I'd prefer staying with this, I'm just suggesting executables such as COM would be a good starting point to make Cosmos even better and more attractive to developers. Anyway, to make a syscall, don't you just set up an interrupt handler on a port e.g. 0x80, then read the registers for the task that needs doing, do it, then return? -Aurora

Coordinator
Feb 17, 2012 at 9:29 AM
that's traditional syscalling, but we dont want that. We can do much more intelligent stuff, but that's for later on.
if you place your executable in a separate assembly (even as console applicatin is possible) but for now just reference it and run the main method, it just works right now.

On Fri, Feb 17, 2012 at 11:25 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

Well, I like the idea of Cosmos, so I'd prefer staying with this, I'm just suggesting executables such as COM would be a good starting point to make Cosmos even better and more attractive to developers. Anyway, to make a syscall, don't you just set up an interrupt handler on a port e.g. 0x80, then read the registers for the task that needs doing, do it, then return? -Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 9:34 AM

It's OK doing that, but compiling it all in the kernel is my main problem with that - one change and then you have to compile the app, then the kernel, then the OS. Dynamic loading would be far better, but I understand that's a while down the road.

Coordinator
Feb 17, 2012 at 9:37 AM
maybe you could join the irc channel, and we can discuss there, but the whole dependency-tree is handled by vs.. :)

On Fri, Feb 17, 2012 at 11:34 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

It's OK doing that, but compiling it all in the kernel is my main problem with that - one change and then you have to compile the app, then the kernel, then the OS. Dynamic loading would be far better, but I understand that's a while down the road.

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 9:38 AM

OK then :)

-Aurora

Feb 17, 2012 at 9:42 AM

By the way: Your IRC link is down, so what channel do I have to join? :)

-Aurora

Coordinator
Feb 17, 2012 at 9:44 AM
#cosmos-dev on freenode

On Fri, Feb 17, 2012 at 11:42 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

By the way: Your IRC link is down, so what channel do I have to join? :)

-Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Feb 17, 2012 at 9:44 AM
mterwoord wrote:
#cosmos-dev on freenode

On Fri, Feb 17, 2012 at 11:42 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

By the way: Your IRC link is down, so what channel do I have to join? :)

-Aurora

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


  Thanks