printf (' hello world! ');

Shawn T. Rutledge rutledge@cx47646-a.phnx1.az.home.com
Fri, 30 Jun 2000 17:12:15 -0700


On Fri, Jun 30, 2000 at 04:52:40PM -0700, Kevin Buettner wrote:
> On Jun 30,  4:09pm, Shawn T. Rutledge wrote:
> 
> > > What is the Linux equivalent of assembly ?
> > 
> > You can do assembly in Linux, the assembler is as86.  There is also
> > nasm I believe.  
> 
> Don't forget gas.  (The GNU ASsembler used by gcc.)

The man page for as says that it is the GNU assembler.  I thought
maybe as86 was the x86 component of it but they are actually two
separate executables on my system.
> 
> > But I haven't done it.  I suspect you could still
> > make function calls to libc functions for doing output, etc.  I
> > don't think it gets much use outside the kernel itself.
> 
> I think you're talking about inline assembler.  It comes in handy from

No I was talking about how to do hello world... you'd need to write
to stdout.  That would involve either a libc call or a direct ioctl 
call wouldn't it?

> time to time for directly accessing the CPU's registers and for
> executing instructions (e.g, cache flushing / synchronization

Yeah that's useful.  I've done it in DOS C and/or Pascal compilers 
before, in the distant past.  Or maybe I was just using the instructions
that Turbo Pascal and C used to have, to directly access registers
and call interrupts.  For one thing, it was the only way to access
the mouse back then; there were no library functions for that. 
If the mouse driver was installed then you could get the coordinates
by calling some interrupt and they would show up in the registers.
You could also output text to the screen much faster by writing it
directly to the video memory, and I did that in a couple of programs.
It made a huge difference.  Later they rewrote the conio (?) library
so that you had a choice when compiling, whether to use DOS interrupts
the way IBM intended or just write to video memory.

You gotta admit, low-level hacking isn't quite as accessible as it
used to be.  Kernel hacking is intimidating.  About as far as I got, 
was that I once tried to back-port the DE620 ethernet driver to an 
older kernel.  I gave up; it was too hard to understand, and a lot 
had changed in the interfaces to the rest of the kernel.  New parameters
added, old ones gone, things renamed, and so on.

-- 
  _______                   Shawn T. Rutledge / KB7PWD  ecloud@bigfoot.com
 (_  | |_)          http://www.bigfoot.com/~ecloud  kb7pwd@kb7pwd.ampr.org
 __) | | \________________________________________________________________
Get money for spare CPU cycles at http://www.ProcessTree.com/?sponsor=5903