assemby int x80 doesn't do anything
assemby int x80 doesn't do anything
I'm in user mode, using gdb the debugger just steps over the int instruction.
Interrupts are enabled according to EFLAGS.
any thoughts ?
Interrupts are enabled according to EFLAGS.
any thoughts ?
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: assemby int x80 doesn't do anything
Hello.
If this is Linux Assembly, please can I have the code where it doesn't work.
Thanks
Steve.
If this is Linux Assembly, please can I have the code where it doesn't work.
Thanks
Steve.
Re: assemby int x80 doesn't do anything
What gdb instruction are you using to single-step your code?
Re: assemby int x80 doesn't do anything
siiansjack wrote:What gdb instruction are you using to single-step your code?
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
Re: assemby int x80 doesn't do anything
This is not a Linux assembly.stevewoods1986 wrote:Hello.
If this is Linux Assembly, please can I have the code where it doesn't work.
Thanks
Steve.
It's a flat binary file I jump into once I switch to user mode and execute it.
The code for it:
Code: Select all
0: e8 02 00 call 0x5
3: 00 00 add %al,(%bx,%si)
5: eb fe jmp 0x5
7: 55 push %bp
8: 89 e5 mov %sp,%bp
a: cd 80 int $0x80
c: b8 00 00 mov $0x0,%ax
f: 00 00 add %al,(%bx,%si)
11: 5d pop %bp
12: c3 ret
13: 00 14 add %dl,(%si)
15: 00 00 add %al,(%bx,%si)
17: 00 00 add %al,(%bx,%si)
19: 00 00 add %al,(%bx,%si)
1b: 00 01 add %al,(%bx,%di)
1d: 7a 52 jp 0x71
1f: 00 01 add %al,(%bx,%di)
21: 7c 08 jl 0x2b
23: 01 1b add %bx,(%bp,%di)
25: 0c 04 or $0x4,%al
27: 04 88 add $0x88,%al
29: 01 00 add %ax,(%bx,%si)
2b: 00 1c add %bl,(%si)
2d: 00 00 add %al,(%bx,%si)
2f: 00 1c add %bl,(%si)
31: 00 00 add %al,(%bx,%si)
33: 00 d3 add %dl,%bl
35: ff (bad)
36: ff (bad)
37: ff 0c decw (%si)
39: 00 00 add %al,(%bx,%si)
3b: 00 00 add %al,(%bx,%si)
3d: 41 inc %cx
3e: 0e push %cs
3f: 08 85 02 42 or %al,0x4202(%di)
43: 0d 05 48 or $0x4805,%ax
46: c5 0c lds (%si),%cx
48: 04 04 add $0x4,%al
Last edited by stdcall on Sun Aug 13, 2017 8:19 am, edited 1 time in total.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
Re: assemby int x80 doesn't do anything
If the code isn't running under Linux, how is it running? (It looks like real mode.) Is there actually an int 0x80 handler?
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: assemby int x80 doesn't do anything
I see a contradiction here.stdcall wrote: The code for it:Code: Select all
00000000 <.data>:
Re: assemby int x80 doesn't do anything
BTW, note that the interrupt flag has no connection with a software interrupt.
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: assemby int x80 doesn't do anything
True, it could be an exception (fault). What platform is he/she using? Int 0x80 is Linux.iansjack wrote:BTW, note that the interrupt flag has no connection with a software interrupt.
Re: assemby int x80 doesn't do anything
A software interrupt cannot be an exception.
Re: assemby int x80 doesn't do anything
This is no Linux, this is my OS. there's a dedicated isr 0x80 handler I've written and placed in the IDT. and event if there wasn't I would expect to see a general exception fault.stevewoods1986 wrote:True, it could be an exception (fault). What platform is he/she using? Int 0x80 is Linux.iansjack wrote:BTW, note that the interrupt flag has no connection with a software interrupt.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
Re: assemby int x80 doesn't do anything
That's not a contradiction, the format I use for executable is just plain binrary, there are no sections like in ELF.XenOS wrote:I see a contradiction here.stdcall wrote: The code for it:Code: Select all
00000000 <.data>:
so basically to dump the assembly out of the binary I typed:
Code: Select all
objdump -D -b binary -mi386 -Maddr16,data16 ./binary_code
program: file format binary
Disassembly of section .data:
00000000 <.data>:
0: e8 02 00 call 0x5
....
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
Re: assemby int x80 doesn't do anything
I found a workaround around this but I don't seem to understand why it didn't work.
I changed the int number to 0x40 instead of 0x80 and now it works perfectly.
I don't get it.
I changed the int number to 0x40 instead of 0x80 and now it works perfectly.
I don't get it.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
Re: assemby int x80 doesn't do anything
You haven't really said anything about the context of your issue.stdcall wrote:I found a workaround around this but I don't seem to understand why it didn't work.
I changed the int number to 0x40 instead of 0x80 and now it works perfectly.
I don't get it.
Are you running Linux, on which you run Qemu, on which you run your own OS, on which you run some test app you compiler that tries to use int 0x80? And you are using gdb from the host Linux to connect to Qemu and single stepping over said int 0x80?
Are you using a recent version of Qemu or something ancient? Did you compile it or use a packaged one? Are you using KVM with Qemu or..?
Re: assemby int x80 doesn't do anything
I'm Running Linux, on top of that I run Qemu and I'm connecting to the os using remote GDB protocol and Qemu offers.LtG wrote:You haven't really said anything about the context of your issue.stdcall wrote:I found a workaround around this but I don't seem to understand why it didn't work.
I changed the int number to 0x40 instead of 0x80 and now it works perfectly.
I don't get it.
Are you running Linux, on which you run Qemu, on which you run your own OS, on which you run some test app you compiler that tries to use int 0x80? And you are using gdb from the host Linux to connect to Qemu and single stepping over said int 0x80?
Are you using a recent version of Qemu or something ancient? Did you compile it or use a packaged one? Are you using KVM with Qemu or..?
The OS bootstraps and then runs a process in user mode. the process is a flat binary that is loaded via grub modules.
It appears that even before switching to user mode, int 0x80 doesn't do anything.
changing the number from 0x80 to something else (0x40) solved the issue, now the interrupt occurs.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2
Educational Purpose Operating System - EPOS