Page 1 of 1

Line discipline under FinalEdition update 2 [solved - see flushing line]

Posted: Fri Feb 14, 2025 2:16 pm
by gdridi
Hello!

From the last response it seems that line discipline or line buffering [input/output] are not correct:

Understanding getchar() and putchar() in C - Stack Overflow

https://stackoverflow.com/questions/287 ... tchar-in-c

When I used DOSpacket handler of mine, it goes two times in ACTION_READ, ACTION_READ unnecessary buffering line with ‘\n’ [multiline] instead of ACTION_READ, ACTION_WRITE flushing the line ended with NewLine char.

Why FEu2 (on my A1222+ also) does this (don’t know) because my handler works well with FEu0 on my SAM.

Hope someone of kernel developer found the reason (this is on DOS handler processes not interleaving well due to LibC library underneath kernel code.

Sincerely,
DGILLES

Code: Select all

#include proto/DOS.h
int main() {
int c;
if ( IDOS->Read(IDOS->Input(), &c, 1) != 0 ) IDOS->Write(IDOS->Output(), &c, 1);
}
But this code (passing in libc buffering? or bad underneath kernel management?) not working:

Code: Select all

int main() {
int c;
if ( (c = getchar()) != EOF ) putchar(c);
}