I think I found out to access 64 bit registers in COSMOS

Topics: Other, Using Cosmos (Developing your own OS, projects, etc)
Sep 24, 2012 at 1:24 AM

Here is how my scheme works:

1) Plug the asm instruction "Call"

2) Load the raw binary code for something like "push rax" into memory

3) Use the plugged call method to call that code

 

I have seen that Grunt has got some asm raw binary compiling and running done as I watch his youtube videos. Would you or anyone else please explain if my method is feasible (And I know to preserve cx when calling). Also, how do you find the raw binary code for something like: "push rax"?

Coordinator
Sep 24, 2012 at 12:53 PM
On 9/23/2012 9:24 PM, gungan37 wrote:
> From: gungan37
>
> Here is how my scheme works:
>
> 1) Plug the asm instruction "Call"
>
> 2) Load the raw binary code for something like "push rax" into memory
>
> 3) Use the plugged call method to call that code

You dont need to load raw bin, you can just use an ASM plug and emit the
text "push rax" in the assembler.
Coordinator
Sep 24, 2012 at 12:58 PM
is RAX available when running in 32bit protected mode?



On Mon, Sep 24, 2012 at 2:53 PM, kudzu <notifications@codeplex.com> wrote:

From: kudzu

On 9/23/2012 9:24 PM, gungan37 wrote:
> From: gungan37
>
> Here is how my scheme works:
>
> 1) Plug the asm instruction "Call"
>
> 2) Load the raw binary code for something like "push rax" into memory
>
> 3) Use the plugged call method to call that code

You dont need to load raw bin, you can just use an ASM plug and emit the
text "push rax" in the assembler.

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


Sep 26, 2012 at 1:55 AM

Sorry for the late reply guys!

Kudzu: I didn't know NASM supported AMD64. Thanks for pointing that out!

mterwood: You're right. I didn't realized that in protected mode you could only use 32 bit stuff. I will write a plug to go between Real Mode, Long Mode, and Protected Mode once I have time. Thanks also for making the point.