* Added simplified possibility to schedule UHCI transfers from within KDL.
* Added debugger commands to resolve usb_ids to pipes. * Adjusted the physical memory allocator to be usable in a slimmed down mode when running inside the kernel debugger. * Implemented USB keyboard support for KDL through a kernel debugger add-on. * Added kgetc() and made use of it where previously individual methods were used to ensure that reading characters always goes through the kernel debugger add-ons and the other methods. This has some preconditions to meet though: 1) The keyboard must be in the boot protocol (currently the case but needs to be revisited once we have a full usb_hid). 2) The keyboard must be attached to a UHCI root port (i.e. not use EHCI or OHCI, also not through hubs unless those are USB 1.1). 3) the usb_hid driver has to be opened for this to work. This means that for the time between initializing USB and when usb_hid is opened by the input_server there is no keyboard support. Also note that this has no way of detecting hot-plug, meaning that you can't re-attach your USB keyboard from the hub to the root port once in KDL. On the bright side of things, since this is a non-destructive mechanism it is possible to enter and leave KDL without loosing the USB state. Tested OK in QEMU, not tested on real hardware yet, will see in a few minutes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29291 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -408,27 +408,8 @@ read_line(char* buffer, int32 maxLength,
|
||||
bool done = false;
|
||||
char c = 0;
|
||||
|
||||
char (*readChar)(void);
|
||||
if (sBlueScreenOutput)
|
||||
readChar = blue_screen_getchar;
|
||||
else
|
||||
readChar = arch_debug_serial_getchar;
|
||||
|
||||
while (!done) {
|
||||
bool hasChar = false;
|
||||
for (uint32 i = 0; i < kMaxDebuggerModules; i++) {
|
||||
if (sDebuggerModules[i] && sDebuggerModules[i]->debugger_getchar) {
|
||||
int getChar = sDebuggerModules[i]->debugger_getchar();
|
||||
if (getChar >= 0) {
|
||||
hasChar = true;
|
||||
c = (char)getChar;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasChar)
|
||||
c = readChar();
|
||||
c = kgetc();
|
||||
|
||||
switch (c) {
|
||||
case '\n':
|
||||
@@ -487,12 +468,12 @@ read_line(char* buffer, int32 maxLength,
|
||||
}
|
||||
break;
|
||||
case 27: // escape sequence
|
||||
c = readChar();
|
||||
c = kgetc();
|
||||
if (c != '[') {
|
||||
// ignore broken escape sequence
|
||||
break;
|
||||
}
|
||||
c = readChar();
|
||||
c = kgetc();
|
||||
switch (c) {
|
||||
case 'C': // right arrow
|
||||
if (position < length) {
|
||||
@@ -548,7 +529,7 @@ read_line(char* buffer, int32 maxLength,
|
||||
case '5': // if "5~", it's PAGE UP
|
||||
case '6': // if "6~", it's PAGE DOWN
|
||||
{
|
||||
if (readChar() != '~')
|
||||
if (kgetc() != '~')
|
||||
break;
|
||||
|
||||
// PAGE UP: search backward, PAGE DOWN: forward
|
||||
@@ -603,7 +584,7 @@ read_line(char* buffer, int32 maxLength,
|
||||
}
|
||||
case '3': // if "3~", it's DEL
|
||||
{
|
||||
if (readChar() != '~')
|
||||
if (kgetc() != '~')
|
||||
break;
|
||||
|
||||
if (position < length)
|
||||
@@ -649,6 +630,25 @@ read_line(char* buffer, int32 maxLength,
|
||||
}
|
||||
|
||||
|
||||
char
|
||||
kgetc(void)
|
||||
{
|
||||
// give the kernel debugger modules a chance first
|
||||
for (uint32 i = 0; i < kMaxDebuggerModules; i++) {
|
||||
if (sDebuggerModules[i] && sDebuggerModules[i]->debugger_getchar) {
|
||||
int getChar = sDebuggerModules[i]->debugger_getchar();
|
||||
if (getChar >= 0)
|
||||
return (char)getChar;
|
||||
}
|
||||
}
|
||||
|
||||
if (sBlueScreenOutput)
|
||||
return blue_screen_getchar();
|
||||
|
||||
return arch_debug_serial_getchar();
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
kgets(char* buffer, int length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user