[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] newbee med adresse problemer



On Wed, 22 May 2002, thomas jensen wrote:

> 
> 
> hej jeg er ved at lave et i/o kort til isa slot
> men kan ikke få c programmet til at adressere det??
> har prøvet med denne manual
> http://www.tldp.org/HOWTO/mini/IO-Port-Programming-1.html
> men jeg syntes ikke det virker
> systemet skriver : segmentasion fault (core dump)
> jeg har lavet programmet sådanne her:
> 
> #define extern static
> #include<asm/io.h>
> #include<asm/unistd.h>
> #undef extern
> char hent;                        //variabler
> int main()
> {
> ioperm(0x280,4,1);         //klargøring af port

Fra man siden: 
RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and errno 
is set appropriately.

Så, 
#include <stdio.h>
#include <errno.h>
if (ioperm(0x280, 4, 1)) {
  perror("Argh, jeg er nok ikke root!\n");
}


> hent=inb(280);                //her hentes indholdet af port 280 til hent
> printf("%d",hent);            //her skrives indholdet af hent
> getchar();
> return 0;
> }
> 
> jeg har også prøvet vor jeg ville skrive til porten og resultat blev det
> samme

inb og venner kræver at du bruger -O for at oversætte (måske endda -O2). 
Hvordan oversatte du dit program?

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
Pretty cool, the kind of power information technology puts in our hands
these days. 
    - Securityfocus on probing 36000000 hosts for known problems in 3 weeks



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *