Programming :: Simulate A Serial Protocol In User Space Program To Test Reception Algorithm?

Jul 28, 2010

I want to simulate a serial protocol in user space program to test reception algorithm. The protocol is similar to UART protocol but frame format is different. The duration of 1 bit is 114,46 us. In my main function I'm creating two threads. Tx for simulating transmitting data and Rx for reception data. For measure time I use create_timer() function and signals. Each thread has its own timer and signal handler. Tx timer uses SIGUSR1 and Rx timer uses SIGUSR2. Tx thread sets the global variable and Rx reads it.

The timers are set to sample with 114,46 us period. When they reach this value signal handler should set the flag. Flag is check in thread and some operation are made. When I set the timers period for longer time (100 ms) everything works fine but when I change it to default value (114,46 us) the Rx thread doesn't receive the proper data. I am wondering if the 114,46 timer period is possible to simulate in user space? Whether the time will give me the proper resolution ? Theoretically it should provide 1 ns resolution.

View 3 Replies


ADVERTISEMENT

Programming :: Simulate Dijsktra's Algorithm Using Network Animator Of Ns2?

May 3, 2011

I need to simulate dijsktra's algorithm using network animator of ns2. how to write a tcl script for my code. This tcl script runs the dijsktra code and simulates its running on network animator.

View 1 Replies View Related

Programming :: Encryption And Decryption Program In Java And Using RSA Algorithm?

Feb 25, 2011

i need a program for Encryption and Decryption using RSA algorithm in JAVA ..

View 9 Replies View Related

Software :: Simulate Serial Device With Pty's ?

Sep 21, 2009

I wrote software which access and reads a serial device. I would like to test this software on my computer without loop-wiring or without a second computer.

How could I use pty's to simulate a serial device?

Actually I would like to temporary replace the /dev/ttyS1 file by one end of the pty. How could I do this? Is there a command to create a pty pair?

View 4 Replies View Related

Programming :: RTS Toggling In Serial Port From Kernel Space?

Jan 29, 2010

Driven by my needs , i need to toggle only the flow control (RTS, CTS) bits and have nothing to do with the rest of the functionality (e.g. normaltx , rx operation). I am presuming that there exists a line discipline from user space for toggling RTS as ioctl (*file, cmd, *unsigned long ) can be used easily to toggle RTS. However, the use of IOCTL in kernel space for the same purpose brings about no change on RTS (oscilloscope shows no change). google led me to this [URL] and according to that i should make changes directly in the driver.

Code:

int x=0;
int actual_module()
{ int k;
mm_segment_t oldfs;

[code]....

View 3 Replies View Related

Programming :: Passing Data Between Kernel Space To User Space In Asynchronous Way

Dec 13, 2010

I am developing a I2C CDROM client driver. The CDROM firmware supports TOC information read through a I2C command. It sends the TOC information in burst ( Interrupts a GPIO pin when it is ready ) and my CPU does a I2C read to read the TOC. When the CDROM firmware finishes sending the last data burst , it informs my CPU that it is done with the TOC, by a flag in the last data burst. I would like to know, which is the most efficinet way I can send these TOC information to userspace?

View 4 Replies View Related

Programming :: Function In Kernel Space Called Form User Space

Jul 7, 2009

I wanna write a file in kernel space but from my searching I can to know that instead of writeing file in kernel space ,I can write data to user space by copy_to_user space.

But link is missing ...I dont know how will my user space will access kernel space means my function in kernel space which will do copy_to_user /....How my user space function will call my kernel level function ..

Can any one of you provide me with some example file which are doing this .I know every char driver is using it ...but i could not trace back how user level function is accessing it ...i m confused between user space and kernel space.

View 2 Replies View Related

Programming :: Call Socket Prog Code Written In User Space From Kernel Space?

Jul 14, 2009

How to use execv from kernel space to call a user space program writtenfor socket prog.

I tried to write code for socket in kernel but its not working.

Socket code in kernel is also needed.

View 2 Replies View Related

Programming :: Signal From Kernel Space To User Space?

Jul 21, 2011

I have the following requirement in my module. The driver gets some data from the external device. After getting 1MB of data it has to send it to the user space application. What is the best thing to implement for this in driver.? Is it ok to implement like, after getting data, the driver will send a signal to the user space application. Then the user space application sends an ioctl to read the data. Is there any alternate, that the driver directly sends the data without the user space application asks for it.?

View 4 Replies View Related

Programming :: Test Program To Get The CPU Utilisation

Mar 9, 2010

I wrote a test program to get the CPU utilisation. I hope to extend it to take cpu utilisation on multi core machines. Hear I used the equation for taking cpu utilisation given at [url] of JmSchanck post. But when I match the output of my program against 'top' and 'system monitor' output it seems quite high. Sometimes cpu utilisation goes more than 100%.

So the given equation in that url is correct? can anyone give me the equation to take CPU utilisation?

Code:

View 3 Replies View Related

Programming :: Porting Serial Port Program From Windows?

Jan 8, 2009

I bought a set of 3 laser sensors and it came with a software and its C++ source code for windows to receive the lasers info through the serial port. Since the entire project is running on Linux, I need to port the windows code to Linux. At the present moment, I already can receive the data from each of the 3 sensors, but the info is coming concatenated! Tracking down the original windows code, I found that it is probably happening cause I didn't ported these lines to my Linux version:

Code:

COMMTIMEOUTS CommTimeouts;
[...]
CommTimeouts.ReadIntervalTimeout = 2;

[code]....

I've searched already about how to specify the serial port timeouts on Linux, but didn't find a solution. how to port these lines to Linux or maybe where to find more info about how to set serial port timeouts on Linux?

View 4 Replies View Related

Programming :: Serial Port Program Not Outputting The Right Data?

Apr 11, 2009

I have connected a device to my linux system with a serial cable (rs232). The settings are: port /dev/ttyS0, baud rate=38400, data bits=8, stop bits=1, no parity, no hardware or software handshaking. I wrote a linux program that sends 1 byte to the device, but the device doesn't receive it. I know the serial ports are working because when I use the CuteCOM application to send data, the device DOES receive it, so obviously it is a problem with my code..

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

[code].....

View 2 Replies View Related

Ubuntu Security :: Pen Test IIS - Methods To Simulate Attacks To Check HIPS Detects?

Jan 27, 2011

I need to do a pentest on a Microsoft IIS webserver to test the efficiency of the HIPS i have installed on. methods to simulate attacks so that i can check if the HIPS will detect them?

View 4 Replies View Related

Programming :: Passing Input To Program For Test

Apr 13, 2011

I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file. I have got an input from my lecture and she said after compiling in Linux I must write:

1-to compile:
Code:
g++ (files with cpp)
2-to see the output:
Code:
./a.out
3-to test with input:
Code:
./a.out < input.txt >

My problem is in step three. What I must write in the command part after" step2" to see the output?

View 3 Replies View Related

Programming :: Script To Test If Program Is Running

Sep 22, 2010

I'm trying to test whether wget is working still or not. While [ wget is still running ] <----- but how should this look please?
do
codes
done

View 4 Replies View Related

Programming :: Test Program Without Making A Copy Outside The Git Working Dir?

Jan 30, 2010

I was windering, if you are writing a C program, I don't think you are supposed to commit the .o files and executables. How can you test your program without making a copy outside the git working dir?

View 3 Replies View Related

Programming :: Serial Port Communication Program Always Lose One Byte Data: 0x00?

Dec 13, 2009

I wrote a serial port communication program to access a equipment.

int main(void)
{
int fd = 0;
int nread = 0,i = 0,nwrite = 0, tmpread = 0, m = 0, n = 0 ;

[code]....

View 2 Replies View Related

Software :: Best Program To Write Algorithm?

Oct 5, 2010

What would be the best program to write my algorithm, before sending them to my teacher?

View 4 Replies View Related

Programming :: Bash Shell Read User Argument From Command Line And Test It

Aug 29, 2010

Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.

The script is the following but i get an error saying "[: 6: =: argument expected"

View 12 Replies View Related

General :: Division Of Logical Memory Space In To User Space And Kernel Space

Jan 4, 2010

Logical Memory Space of 4GB is divided in to 3GB User Space and 1GB Kernel Space. Always. Correct?

1. How can we change it? (just changing value of PAGE_OFFSET is okay?)

2. If system have only 256MB of memory (embedded system) and suppose Kernel Modules eat away all the memory during boot. User space will be left will no memory. Is this case possible?

View 2 Replies View Related

Programming :: Disable Irq Line From User Space?

Jul 14, 2011

I have written a device driver and I would like to disable an interrupt. In kernel space there is a function called "disable_irq(int irq)", but, is it possible to do it from user space?

View 7 Replies View Related

Programming :: Issue Ioctls To A Usb Driver From User Space?

Sep 17, 2010

I am looking for a way to issue ioctls to a usb driver from user space. Upon googling, I found that usbfs provides a way to do that, anyhow I can't find sample code to try that out.

Note:
I have written a sample usb driver on the lines of 'Linux device drivers' book. Now I need to try ioctls with usb drivers.

View 2 Replies View Related

Programming :: Vmsplice And Splice Usage In User Space?

Jun 10, 2009

I'm using vmsplice & splice to send memory buffers through a TCP socket. I have two issues using these methods:

1) According to the documentation, when using vmsplice with the flag SPLICE_F_GIFT, you cannot modify the buffer you've "given" the kernel. Currently, each time I want to send a buffer, I have to allocate a page-aligned buffer (fill it with data) and send it using vmsplice- splice. When can I deallocate this buffer? Is it possible to modify this buffer after the buffer is sent through the socket?

2) The buffer should be page-aligned both in memory and in length, but most of the time the sent messages (to the TCP socket) - are smaller than a page size - is it possible to "clear" the pipe from the remaining buffer?

View 1 Replies View Related

Ubuntu :: Simulate A Floppy Drive With User Read Write

Sep 17, 2010

I have a computer with no floppy drive (x64 ubuntu lucid installed) I have a program (wine windows xp) that will only save data and export data from/to a floppy drive. I found information on setting up an emulated floppy drive. i.e.

sudo dd bs=512 count=2880 if=/dev/zero of=imagefile.img
sudo mkfs.msdos imagefile.img
sudo mount imagefile.img /media/floppy -o loop

I modified the winecfg to include under the drive section A: /media/floppy. Problem is I cannot write to the drive as a normal user. I have tried everything I know but only root can read write to the drive. Is there someway to set up this emulated floppy to allow me as a user to write and read contents.

View 1 Replies View Related

Programming :: Make A (user Space )process Pre Emptive / In 2.6 Kernel?

Dec 10, 2008

I am writing a program which i dont want the kernel scheduler to preempt before certain time duration. I am using the system call sched_get_priority_max to set the maximum priority. However it is not producing results.

View 3 Replies View Related

Programming :: Implementation Of RSA Algorithm In C / C++

Aug 2, 2010

Can I know the implemention of RSA(Encryption and decryption) algorithm in C / C++.

View 1 Replies View Related

Programming :: MD5 Algorithm Implementation

Apr 27, 2011

I have a copy of the MD5 algorithm and I'm taking a look at the source. It's pretty interesting but there are a few things that I'm curious about and I was wondering if anyone a bit more intuitive than I could help me out.The function declarations in the MD5 files are a bit unfamiliar to me. There is a macro used called PROTO_LIST, which I'm still not sure as to what this thing is doing exactly, but it's littered everywhere throughout the source.The signature here isn't too unfamiliar to me with the exception of the position of the PROTO_LIST macro. So here is a function with an unnamed argument of type MD5_CTX*.To me, this resembles an initializer list found in C++ with constructors but I certainly don't think that is the case here. So my questions about this are (1) how is this legal code in C and (2) what functionality has the PROTO_LIST macro provided for the function?

View 3 Replies View Related

Programming :: Simulate Unix Kernel In C++ ?

Jun 2, 2010

How simulate unix kernel in c++..or give me a link....

View 2 Replies View Related

Debian Programming :: How To Simulate Script Execution

Aug 7, 2015

I'm trying to save the output of the script I wanna run but for some reason I cant manage to do it with "script.sh > Output_4.txt"

The thing is that the script was already run and it extracted some directories so when I try to run it again (to save the log to a Output_4.txt) bash says (see screen-capture) and of course the log's empty!!!!

View 2 Replies View Related

Programming :: Which Is Scheduling Algorithm Which Will Make Thread O?

May 4, 2011

I have a timer thread, and when it expires, it sets a flag. The only problem is, if any higher priority thread comes in between, then the timer is not expired in real time.Thus i want to set a highest priority to my thread. Now, i know 2 algos, which can make my thread in real time are: SCHED_FIFO and SCHED_RR.

So, here are my queries: 1) Which scheduling algo is best suited for this purpose? 2) Is it guaranted to work in real time if i use that algo (you suggest in 1) and set the max_priority by getting the maximum settable priority for that particular algorithm using, int sched_get_priority_max(int policy);

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved