Question
Help me write poll() function in MPX! (instructions included!) Hello, I am having great trouble with creating poll() function in c language and dont even
Help me write poll() function in MPX! (instructions included!)
Hello, I am having great trouble with creating poll() function in c language and dont even know where to start with
Here are the description for the poll:
you will write a special method that will poll for characters from the serial port and store them one at a time into the character buffer until a return is received or the buffer is full. Polling works as follows.
For now, polling I/O will be implemented to collect input from the user's keyboard
The Intel 8250 UART contains multiple registers which are used to set options and get information.
Data will be collected on a character-by-character basis and stored in the COM1 BASE register (0x3F8)
When data is available, the 8250 sets the least significant bit in the line status register (COM1+5)
Therefore, your polling code may look something like:
while (1) // Run continuously
if inb(COM1+5)&1 // Is a character available?
char letter = inb(COM1); //Get the character
// STORE & PRINT or HANDLE the character
Note: The inb instruction reads a byte from a particular port
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started