|
|
Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: Linux Assembly Examples - msg#00018
List: linux.assembly
Greetings Chaps & Chapesses,
A PLEA FROM A LINUX ASSEMBLER NEWBIE...
Does anyone know of a repository of Linux Assembly examples ?
I'm new to Linux Assembly - assembly in general, actually - having written a
few things for That Other System only. In order that I may Stand on the
Shoulders of Giants, rather than re-invent the wheel, I could do with looking
at some GOOD, WORKING examples - assembler in KDE, GNOME, QT etc...
As a comparison to That Other System, Linux seems to be short of players in
the area of assembler - please don't direct me to LinuxAssemly.org, as far as
I can tell the only thing there is the pale shadow of inertia.
Many thanks, in anticipation
The Phantom Phinger
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
How to Use the vm86 System Call
Does anyone know how to make use of the vm86 system call? The man page for it
is pretty light on the details, and the names of the fields of the structures
in the header file aren't very explanatory.
All I can seem to find on the internet is stuff like this:
16:02:17 <SLACKo> anyone knows how to use vm86() ?
16:02:24 <SLACKo> system call
16:02:59 <SLACKo> how can I creat the struct vm86plus_struct
16:03:03 <SLACKo> ?
16:03:15 <SLACKo> I couldn't find any documentation on that
16:06:53 <air> #include <sys/vm86.h>
16:07:13 <air> /usr/include/sys/vm86.h
16:07:22 <air> all the documentation u could ever want
16:07:48 <SLACKo> couldn't find what the struct members should contain
16:07:55 <SLACKo> :(
16:08:23 <SLACKo> struct vm86plus_struct {
16:08:24 <SLACKo> struct vm86_regs regs;
16:08:24 <SLACKo> unsigned long flags;
16:08:24 <SLACKo> unsigned long screen_bitmap;
16:08:24 <SLACKo> unsigned long cpu_type;
16:08:26 <SLACKo> struct revectored_struct int_revectored;
16:08:26 <SLACKo> struct revectored_struct int21_revectored;
16:08:28 <SLACKo> struct vm86plus_info_struct vm86plus;
16:08:36 <SLACKo> };
It seems so hopeless.
I was working on a new Softer-like thing, except that it would work in framebuffer mode
too, and it would just provide video access rather than all of that "orange
protocol" stuff. However, I'm writing it to use with a game that I want to release
as shareware, but if the game is shareware, then I want it to work well for people (so
that they'll give me money), and part of working well is being able to run it in whatever
video mode the user wants. With framebuffer, you only get the one video mode that the
framebuffer is in, and that's not very nice since the user might want framebuffer in
1600x1200 because they run X in framebuffer mode, but in all likelyhood they'd rather run
the game in something like 640x480. I'd much rather just call the VESA BIOS and be able
to make it support every mode available in both text mode and framebuffer mode rather
than deal with the unstability of SVGA
lib or the "maybe we can change modes, and maybe we can't" stuff you get with things like SDL
under X, but the vm86 call doesn't seem to be documented anywhere.
I actually decided to write the thing in Windows because of that, but reading
through the Windows documentation, I'm not sure how much of that hungarian
notation I can tolerate. If I could just figure out how to use this vm86 call
then I could make the game support the video modes that I want it to support,
and then I wouldn't have to learn to program for a whole new OS, and I could
write the game in Linux like I origionally wanted to.
(And just in case anyone is wondering, the part that does the graphics modes
would be public domain just like Softer, only the game itself would be closed
source shareware.)
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Next Message by Date:
click to view message preview
Re: How to Use the vm86 System Call
Hello,
--- Richard Cooper <peajay@xxxxxxxxxxxxxxxxx> wrote:
>
> Does anyone know how to make use of the vm86 system
> call?
I don't, but maybe I can provide some info.
> The man page for it is pretty light on the
> details, and the names of the fields of the
> structures in the header file aren't very
> explanatory.
I hope this info can be of some use:
sh-3.00$ gdb dosemu.bin
(gdb) ptype struct vm86plus_struct
type = struct vm86plus_struct {
struct vm86_regs regs;
long unsigned int flags;
long unsigned int screen_bitmap;
long unsigned int cpu_type;
struct revectored_struct int_revectored;
struct revectored_struct int21_revectored;
struct vm86plus_info_struct vm86plus;
}
(gdb) ptype struct vm86_regs
type = struct vm86_regs {
long int ebx;
long int ecx;
long int edx;
long int esi;
long int edi;
long int ebp;
long int eax;
long int __null_ds;
long int __null_es;
long int __null_fs;
long int __null_gs;
long int orig_eax;
long int eip;
short unsigned int cs;
short unsigned int __csh;
long int eflags;
long int esp;
short unsigned int ss;
short unsigned int __ssh;
short unsigned int es;
short unsigned int __esh;
short unsigned int ds;
short unsigned int __dsh;
short unsigned int fs;
short unsigned int __fsh;
short unsigned int gs;
short unsigned int __gsh;
}
(gdb) ptype struct revectored_struct
type = struct revectored_struct {
long unsigned int __map[8];
}
(gdb) ptype struct vm86plus_info_struct
type = struct vm86plus_info_struct {
long unsigned int force_return_for_pic : 1;
long unsigned int vm86dbg_active : 1;
long unsigned int vm86dbg_TFpendig : 1;
long unsigned int unused : 28;
long unsigned int is_vm86pus : 1;
unsigned char vm86dbg_intxxtab[32];
}
(gdb)
You can study the dosemu source code for examples of
use.
However, I would rather use SDL instead.
Bye,
Claudio
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Previous Message by Thread:
click to view message preview
How to Use the vm86 System Call
Does anyone know how to make use of the vm86 system call? The man page for it
is pretty light on the details, and the names of the fields of the structures
in the header file aren't very explanatory.
All I can seem to find on the internet is stuff like this:
16:02:17 <SLACKo> anyone knows how to use vm86() ?
16:02:24 <SLACKo> system call
16:02:59 <SLACKo> how can I creat the struct vm86plus_struct
16:03:03 <SLACKo> ?
16:03:15 <SLACKo> I couldn't find any documentation on that
16:06:53 <air> #include <sys/vm86.h>
16:07:13 <air> /usr/include/sys/vm86.h
16:07:22 <air> all the documentation u could ever want
16:07:48 <SLACKo> couldn't find what the struct members should contain
16:07:55 <SLACKo> :(
16:08:23 <SLACKo> struct vm86plus_struct {
16:08:24 <SLACKo> struct vm86_regs regs;
16:08:24 <SLACKo> unsigned long flags;
16:08:24 <SLACKo> unsigned long screen_bitmap;
16:08:24 <SLACKo> unsigned long cpu_type;
16:08:26 <SLACKo> struct revectored_struct int_revectored;
16:08:26 <SLACKo> struct revectored_struct int21_revectored;
16:08:28 <SLACKo> struct vm86plus_info_struct vm86plus;
16:08:36 <SLACKo> };
It seems so hopeless.
I was working on a new Softer-like thing, except that it would work in framebuffer mode
too, and it would just provide video access rather than all of that "orange
protocol" stuff. However, I'm writing it to use with a game that I want to release
as shareware, but if the game is shareware, then I want it to work well for people (so
that they'll give me money), and part of working well is being able to run it in whatever
video mode the user wants. With framebuffer, you only get the one video mode that the
framebuffer is in, and that's not very nice since the user might want framebuffer in
1600x1200 because they run X in framebuffer mode, but in all likelyhood they'd rather run
the game in something like 640x480. I'd much rather just call the VESA BIOS and be able
to make it support every mode available in both text mode and framebuffer mode rather
than deal with the unstability of SVGA
lib or the "maybe we can change modes, and maybe we can't" stuff you get with things like SDL
under X, but the vm86 call doesn't seem to be documented anywhere.
I actually decided to write the thing in Windows because of that, but reading
through the Windows documentation, I'm not sure how much of that hungarian
notation I can tolerate. If I could just figure out how to use this vm86 call
then I could make the game support the video modes that I want it to support,
and then I wouldn't have to learn to program for a whole new OS, and I could
write the game in Linux like I origionally wanted to.
(And just in case anyone is wondering, the part that does the graphics modes
would be public domain just like Softer, only the game itself would be closed
source shareware.)
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Next Message by Thread:
click to view message preview
Someone should correct me when I'm wrong.
Your program is loaded a little bit above address 0x80000000,
I can't believe no one caught that... Linux programs load a little bit above
0x08000000, not 0x80000000.
The exact address is 0x08048080. Thus there's almost 3GB of space between the
program and the stack.
Hopefully that's all that I got wrong.
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
|
|