EmbLogic's Blog

Daily working report to PRAVJOT SIR about client and server applicaton project……..

Yesterday, we had made a server and with the help of fork and exec we have created a new process(client1) and through this new process(client1) we have send two variables and operator to server.  Now today what we have done is we have created another client2 with the help of fork and exec and send that two variables and operator to it and it performs some operation on it then, after performing function client2 sends result to client1 via server……

Posted in Uncategorized | Leave a comment

To Pravjot Sir

Serial port implemented… multiple bytes

Posted in Uncategorized | Leave a comment

To Pravjot Sir

Serial port done with multiple bytes

Posted in Uncategorized | Leave a comment

Serial_port driver implemented

serial_port driver implemented for multiple bytes

Posted in Uncategorized | Leave a comment

E11

what is linking error?

Posted in Uncategorized | Leave a comment

assignment 1

pleas give me answer of question no.8

Posted in Uncategorized | Leave a comment

parallel port stpper motor via ioctl by zaffer

long scull_ioctl (struct file * filp, unsigned int cmd, unsigned long arg)
{
struct sculldev *lsculldev;
int err=0;
lsculldev=filp->private_data;

#ifdef DEBUG
printk(KERN_INFO”In %s function\n”,__func__);
#endif

#ifdef DEBUG
printk(KERN_INFO”nalue of cmd is %d\n”,cmd);
#endif

if (_IOC_TYPE(cmd) != MAGIC_NUMBER)
{
#ifdef DEBUG
printk(KERN_INFO” MAGIC value of err is %d\n”,err);
#endif
return -ENOTTY;
}
if (_IOC_NR(cmd) > STEPPER_MOTOR_MAX_NR)
{
#ifdef DEBUG
printk(KERN_INFO”STEPPER value of err is %d\n”,err);
#endif
return -ENOTTY;
}

if (_IOC_DIR(cmd) & _IOC_READ){
err = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd));
#ifdef DEBUG
printk(KERN_INFO” IOC_READ value of err is %d\n”,err);
#endif
}

else if (_IOC_DIR(cmd) & _IOC_WRITE){
err = !access_ok(VERIFY_READ, (void __user *)arg, _IOC_SIZE(cmd));
#ifdef DEBUG
printk(KERN_INFO”IOC_WRITE value of err is %d\n”,err);
#endif
}
if (err) return -EFAULT;

switch(cmd)
{
case(MOTOR_START):
{
#ifdef DEBUG
printk(KERN_INFO”motor start\n”);
#endif
outb(0×01,DATA);
outb(0×04,DATA);
}
case(MOTOR_STOP):
{
outb(0×00,DATA);
}
case(ANTICLOCKWISE):
{
#ifdef DEBUG
printk(KERN_INFO”anticlockwise\n”);
#endif
outb(0xF1,DATA);
ssleep(300);
outb(0xF2,DATA);
ssleep(300);
outb(0xF4,DATA);
ssleep(300);
outb(0xF8,DATA);
ssleep(300);
}
case(CLOCKWISE):
{
#ifdef DEBUG
printk(KERN_INFO”clockwise\n”);
#endif
outb(0xF8,DATA);
ssleep(300);
outb(0xF4,DATA);
ssleep(300);
outb(0xF2,DATA);
ssleep(300);
outb(0xF1,DATA);
ssleep(300);
}
case(INCREASE_SPEED):
{

#ifdef DEBUG
printk(KERN_INFO”increase speed\n”);
#endif
outb(0xF8,DATA);
ssleep(30000);
outb(0xF4,DATA);
ssleep(30000);
outb(0xF2,DATA);
ssleep(30000);
outb(0xF1,DATA);
}
case(INCREASE_SPEED):
{

#ifdef DEBUG
printk(KERN_INFO”increase speed\n”);
#endif
outb(0xF8,DATA);
ssleep(30000);
outb(0xF4,DATA);
ssleep(30000);
outb(0xF2,DATA);
ssleep(30000);
outb(0xF1,DATA);
ssleep(30000);
}

case(DECREASE_SPEED):
{
#ifdef DEBUG
printk(KERN_INFO”decrease speed\n”);
#endif

outb(0xF8,DATA);
ssleep(3);
outb(0xF4,DATA);
outb(0xF2,DATA);
ssleep(3);
outb(0xF1,DATA);
ssleep(3);
}
default:
{

#ifdef DEBUG
printk(KERN_INFO”value of cmd is %d\n”,cmd);
#endif

}
}

return 0;
}
……………..
when i press any no it reflects the same no in the ioctl but when it goes in switch case the value of cmd is something 0 ………plz explain…..i tested on 2 systems but same result

Posted in Uncategorized | Leave a comment

E10 array

sir
when we are assign value in array …..
and if we give for loop more than its element….
then next value of array is give -1 of that element’s position……….why ?

Posted in Uncategorized | Leave a comment

E10

sir
i start assignment of shells sripting

Posted in Uncategorized | Leave a comment

Daily working report to PRAVJOT SIR about client and server applicaton project……..

I am a student of w7 batch. Today our batch has started working on “Client and Server Application Project”. Today we have made a server and with the help of fork and exec we have created a new process(client1) and through this new process(client1) we have send two variables and operator to server. Our next objective is to send these variables and operator to another client via server for furhter analysis………..

Posted in Uncategorized | Leave a comment

Base element of array

if 0 then why ?

Posted in Uncategorized | 1 Comment

Status to Pravjot Sir

Successfully implemented Parallel Port:Byte mode according to the protocol.

Posted in Uncategorized | Leave a comment

Status to Pravjot Sir

Successfully implemented Parallel Port:Byte mode according to the protocol.

Posted in Uncategorized | Leave a comment

Status to Pravjot Sir

Successfully implemented Parallel Port:Byte mode according to the protocol.

Posted in Uncategorized | Leave a comment

Status to Pravjot Sir

Successfully implemented Parallel Port:Byte mode according to the protocol.

Posted in Uncategorized | Leave a comment