OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:30 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: assemby int x80 doesn't do anything
PostPosted: Sun Aug 13, 2017 12:06 pm 
Online
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
stdcall wrote:
Code:
-Maddr16,data16

Your code is obviously 32-bit, so why are you telling objdump that it's 16-bit?


Top
 Profile  
 
 Post subject: Re: assemby int x80 doesn't do anything
PostPosted: Sun Aug 13, 2017 12:54 pm 
Offline
Member
Member

Joined: Fri Aug 19, 2016 10:28 pm
Posts: 360
stdcall wrote:
I changed the int number to 0x40 instead of 0x80 and now it works perfectly.
Try passing this command to gdb (if you have the patience to test int 0x80 again):
Code:
set displaced-stepping on
I am not sure if it will help. Nonetheless I think I discovered the culprit. It is an intentional workaround. From the sources, I see that gdb takes care to treat system calls differently for variety of reasons. Which makes sense, because it always thinks that it is operating against user mode processes - whether the target is remote or not. One of the issues is that apparently some kernels when instructed to single step the system call, will trap into the debugger not on the instruction immediately following the int or sysenter, but on the one past it. The debugger works around this by temporarily relocating the next instruction one byte further and by inserting a nop in its stead. Depending on a billion factors, which I gave up trying to reverse engineer, the debugger will either try to use some target feature to reach past the nop (hopefully single stepping), or will insert temporary breakpoint at the relocated address and resume the target. When displaced stepping (the setting above) is not used (including when it is set to auto, and the threads - i.e. cpus for QEMU - operate in stop mode), the target will resume and skip over the syscall. At least this is my understanding from looking at the sources. I am not sure if this will work, but you can try it out.


Top
 Profile  
 
 Post subject: Re: assemby int x80 doesn't do anything
PostPosted: Sun Aug 13, 2017 11:53 pm 
Offline
Member
Member

Joined: Thu Mar 14, 2013 1:30 am
Posts: 78
Octocontrabass wrote:
stdcall wrote:
Code:
-Maddr16,data16

Your code is obviously 32-bit, so why are you telling objdump that it's 16-bit?

You're correct. I fixed it.

_________________
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2

Educational Purpose Operating System - EPOS


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 81 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