Sign in to follow this  
Followers 0
Marconi

C ile Linux

2 posts in this topic

Komut sat?r?nndan port ve verilerin parametre olarak girildi?i bir kod daha haz?rlad?m.

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <asm/io.h>

main(int argc, char *argvek[])
{

if(argc < 3){
printf("Eksik parametre!\n");
exit(0);
}


if(argc > 3){
printf("Cok fazla parametre !\n");
exit(1);
}

int port = atoi(argvek[1]);
int veri = atoi(argvek[2]);

if (ioperm(port,1,1)){
fprintf(stderr, "Couldn't get the port at %x\n", port), exit(1);
}

outb(veri, port);

}[/code]

Buradan derlenmi? haline ula?abilirsiniz;

parametre.rar

Kullan?m?

/parametre 888 255

parametre portadresi veri

888 0x378 hex numalar? portun ondal?k kar??l???d?r.

255 de?eri ise paralel portlara ba?l? b

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0