Is the execute disable bit enabled in Cosmos?

Topics: Developing Cosmos (Working on Cosmos source code directly), Using Cosmos (Developing your own OS, projects, etc)
Developer
Dec 27, 2012 at 2:06 PM

i tried loading my programs to  memory address 0x600000 but nothing happens.

When it loads the registers with the programs address it just halts and has no errors or faults.

Developer
Dec 28, 2012 at 1:17 AM
Have you actually loaded something to the memory location? As in a pointer?


On 28 December 2012 00:36, forest201 <notifications@codeplex.com> wrote:

From: forest201

i tried loading my programs to memory address 0x600000 but nothing happens.

When it loads the registers with the programs address it just halts and has no errors or faults.

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


Coordinator
Dec 28, 2012 at 9:01 AM
also, did you hand over EIP to right location (ie, do a JMP or CALL to the location?)
Besides that, it's also possible that the heap is overwriting your stuff..


On Fri, Dec 28, 2012 at 2:17 AM, Cman332 <notifications@codeplex.com> wrote:

From: Cman332

Have you actually loaded something to the memory location? As in a pointer?


On 28 December 2012 00:36, forest201 <notifications@codeplex.com> wrote:

From: forest201

i tried loading my programs to memory address 0x600000 but nothing happens.

When it loads the registers with the programs address it just halts and has no errors or faults.

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


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


Developer
Dec 28, 2012 at 1:30 PM
mterwoord wrote:
also, did you hand over EIP to right location (ie, do a JMP or CALL to the location?)
Besides that, it's also possible that the heap is overwriting your stuff..

  Yes i did like so->       

  new CPUx86.Mov
  {
      DestinationReg = CPUx86.Registers.EAX,
      SourceValue= 0x600000
       
  };
            
   new CPUx86.Jump { DestinationReg = CPUx86.Registers.EAX};

i loaded the memory address with data like this;
for(int i =0 ; i < Data.Length;i++)
{
  *(byte*)(0x600000 + i) = (byte)Code[i];
}
By the way the program is stored in a byte array;

Dec 28, 2012 at 9:58 PM
forest201 wrote:
mterwoord wrote:
also, did you hand over EIP to right location (ie, do a JMP or CALL to the location?)
Besides that, it's also possible that the heap is overwriting your stuff..

  Yes i did like so->       

  new CPUx86.Mov
  {
      DestinationReg = CPUx86.Registers.EAX,
      SourceValue= 0x600000
       
  };
            
   new CPUx86.Jump { DestinationReg = CPUx86.Registers.EAX};

i loaded the memory address with data like this;
for(int i =0 ; i < Data.Length;i++)
{
  *(byte*)(0x600000 + i) = (byte)Code[i];
}
By the way the program is stored in a byte array;

 

It would be smarter to use memalloc (it is in the heap class, I forgot the namespace) to allocate new memory or your program, that way it does not get overwritten by the heap or stack. And is the code that you are trying to execute 32 bit or 16 bit? Don't forget to add use32 in your assembly code

Jan 4, 2013 at 7:36 PM

Hey I found out that this code does not work, You are going to have to alter EIP some other way.