Opened 12 years ago
Closed 12 years ago
#90 closed defect (fixed)
Implement proper console I/O for SDK mode
Reported by: | dmik | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.8.8 |
Component: | odin | Version: | 0.8.7 |
Severity: | medium | Keywords: | |
Cc: |
Description
When using Odin in SDK mode, the console I/O is not done properly. This means that STDIN/STDOUT handles are implemented using a very restricted set of functions (HMDeviceStandardClass) which only implements reading and writing (regardless of if the handles are the real console or redirected to files etc).
As a result things like GetNumberOfConsoleInputEvents() and PeekConsoleInput() don't work in real console mode (although the code implementing them is present in classes HMDeviceConsoleInClass and HMDeviceConsoleOutClass). And things like SetFilePointer() don't work in redirected mode (although the HMDeviceFile class implements them properly).
Due to these defects, the console I/O got partially broken after r22024 (which fixed a lot of inconsistencies in return codes). In particular, this affects Java which will throw an exception if you e.g. attempt to read something from STDIN.
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Problem 1 is solved in r22051. Problem 2 is really minor -> for tomorrow.
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Hmm, when redirecting to nul, OS/2 reports it's a CHAR device (i.e. console) and this causes the console object to be created and used which prints directly to the attached VIO window ignoring redirection.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I fixed this in r22055 (see the code for a tricky solution).
I sorted it out and made STDIN/STDOUT work in console mode in r22050. Further things to do:
When done, I will enable this console code for SDK mode (by calling iConsoleInit() in Win32LxExe::Win32LxExe() when the application is a VIO session).