Questions tagged [low-level-io]

Byte or character level I/O or functions for performing I/O operations on descriptors.

Byte or character level input/output or functions for performing input/output operations on descriptors.

71 questions
2
votes
1 answer

LPT I/O address mapping in PC

I heard about USB to LPT adapters that are capable of mapping PC legacy parallel port address. What is the level of such mapping? I mean - is it possible to access the adpater's pins by using 'in' or 'out' x86 assembler instructions (in Windows or…
marcin
  • 21
  • 2
2
votes
3 answers

How to accurately read a 64 bit register value using a method that can only read 32 bits at a time?

Came across this question during a past interview, but got no feedback. Since its a register, would I need to disable interrupts before accessing the register inorder to prevent data corruption? Thought of using two buffers, 32 bit and 64 bit, and…
2
votes
1 answer

C Low level I/O : Why does it hang in the while loop?

I'm studying low-level I/O in C for the first time and I'm trying to write a program that prints a file backwards, but it seems that this while loop doesn't work. Why does it happen? #include #include #include #include…
Gibser
  • 197
  • 8
2
votes
1 answer

python.select, sending lists as arguments

r=select([f,s],[],[])[0][0]. Does this mean wait until the file pointed to by f AND s is ready for readiing or f OR s is ready for reading?
Lelouch Lamperouge
  • 8,171
  • 8
  • 49
  • 60
2
votes
1 answer

Altering text in a .txt file and creating a new file output in MATLAB

I apologize in advance if the title seems a bit off. I was having trouble deciding what exactly I should name it. Anyway, basically what I am doing now is completely homework that deals with low-level I/Os. For my one assignment, I have given two…
Jessica Marie
  • 293
  • 5
  • 16
2
votes
1 answer

VBA Writing file in binary mode (overwriting given byte makes unexpected change in the next one, setting it's value to 0)

I want to modify part of .bmp file using VBA, everything works great except that, when I overwrite choosen byte, the next byte is being set to zero. My macro is : Sub WriteBinaryFile() Dim i As Integer Dim nFileNum As Integer Dim sFilename As…
Qbik
  • 5,885
  • 14
  • 62
  • 93
2
votes
1 answer

How to read individual sectors/clusters using DeviceIoControl() in Windows?

I dropped my laptop while Windows was preparing to hibernate and as a result, I got a head crash on the hard drive. (Teaches me to get a hard drive and/or laptop with a freefall sensor next time around.) Anyway, running SpinRite to try to recover…
Ants
  • 2,628
  • 22
  • 35
2
votes
2 answers

C low-level standard-in to accept filename then printing file contents to stdout

I want to get a file name from a user via stdin, open the file with open() and assign it to a file descriptor, then print the contents of that file to stdout. This is my code, and it's not working properly. Problems: the printf("enter filename");…
user2942181
1
vote
0 answers

Why does SystemTable->ConIn functions cause my fans to go insane and freeze the booting process?

So basically, I'm trying to do input with gnu-efi and I've struggled but I finally got something compiling. Here it is: #include #include EFI_STATUS EFIAPI efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { …
1
vote
1 answer

How exactly does file compression work at a low level using Huffman coding? (in C)

TL;DR: How does the compression of plaintext using a Huffman code actually work? I'm currently learning the Huffman coding algorithm and its application to text file compression. I understand that we could store the same data with less size by using…
1
vote
2 answers

Writing data read with read () to int array in C

I have a file with numbers on each line. I am trying to write the data read from the file to the int array with the read () function. I can read the file and print it to the terminal. How can i get the numbers i read into arr array ? Here is my…
ofbahar
  • 43
  • 4
1
vote
1 answer

`read` in C hangs the program when string of length more than 16 entered

I made following program that uses read (system call in C) to get a string from user (of length lesser than 100). #include #include #include int main() { char *s; int a = read(0, s, 100); s[a-1] = '\0'; printf("\"%s\"…
Suraj
  • 67
  • 9
1
vote
0 answers

iopl()/ioperm() for MacOS

Are there equivalent functions for what iopl() does on Linux? I don't need to use just iopl, but other related functions like outb() and inb(). Alternative question, is there an equivalent library for MacOS like sys/io.h on Linux?
dhani
  • 31
  • 1
  • 4
1
vote
1 answer

RFID using Python Socket ( Low Level Commands)

SAAT-520Wireless-Communication-Programming-Development-ProtocolI've been trying to send Lowlevel commands to my RFID to get device information. I'm using wireshark to tap the connection and it seams to be fine as packets seem to go and come from my…
1
vote
1 answer

How to access an OPTICAL block device directly under Windows

The question is similar to How do I read a disk directly with .Net?, except that the drive that requires direct access is a CD-ROM or DVD-ROM drive. These drives are not including as a physical drive and cannot be accessed using the DeviceStream…
Michael
  • 3,821
  • 2
  • 19
  • 18