lkml.org 
[lkml]   [1997]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectOpcodes

This code (to test invd from user mode) simply produced a core-dump.
This is what the trap should have done. I tried this first at home
on a '486 and then tried it here (over the network) on a Pentium.


#include <stdio.h>

main()
{
__asm__ __volatile__(
"invd" );
printf("Was not killed!");
fflush(stdout);
}
-------------------------------------
.file "xxx.c"
.version "01.01"
gcc2_compiled.:
.section .rodata
.LC0:
.string "Was not killed!"
.text
.align 16
.globl main
.type main,@function
main:
pushl %ebp
movl %esp,%ebp
#APP
invd
#NO_APP
pushl $.LC0
call printf
addl $4,%esp
pushl $_IO_stdout_
call fflush
addl $4,%esp
.L1:
movl %ebp,%esp
popl %ebp
ret
.Lfe1:
.size main,.Lfe1-main
.ident "GCC: (GNU) 2.7.2"
--------------------------------------

Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.21 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


\
 
 \ /
  Last update: 2005-03-22 13:38    [from the cache]
©2003-2011 Jasper Spaans