} tSyscallRegs;
// === MACROS ===
-#define HALT() __asm__ __volatile__ ("nop")
+#define HALT() do{}while(0)
// === PROTOTYPES ===
extern void Proc_Start(void);
; Set an IDT entry to a callback
%macro SETIDT 2
mov rax, %2
- mov WORD [rdi + %1*16], ax
+ mov WORD [rdi + %1*16], ax
shr rax, 16
- mov WORD [rdi + %1*16 + 6], ax
+ mov WORD [rdi + %1*16 + 6], ax
shr rax, 16
mov DWORD [rdi + %1*16 + 8], eax
; Enable
- mov ax, WORD [rdi + %1*16 + 4]
- or ax, 0x8000
- mov WORD [rdi + %1*16 + 4], ax
+ mov ax, WORD [rdi + %1*16 + 4]
+ or ax, 0x8000
+ mov WORD [rdi + %1*16 + 4], ax
%endmacro
; Install error handlers
mov dx, 0x20
mov al, 0x11
out dx, al ; Init Command
- mov dx, 0x21
+ mov dx, 0x21
mov al, 0xF0
out dx, al ; Offset (Start of IDT Range)
- mov al, 0x04
+ mov al, 0x04
out dx, al ; IRQ connected to Slave (00000100b) = IRQ2
- mov al, 0x01
+ mov al, 0x01
out dx, al ; Set Mode
- mov al, 0x00
+ mov al, 0x00
out dx, al ; Set Mode
mov dx, 0xA0
mov al, 0x11
out dx, al ; Init Command
- mov dx, 0xA1
+ mov dx, 0xA1
mov al, 0xF8
out dx, al ; Offset (Start of IDT Range)
- mov al, 0x02
+ mov al, 0x02
out dx, al ; IRQ Line connected to master
- mov al, 0x01
+ mov al, 0x01
out dx, al ; Set Mode
- mov dl, 0x00
+ mov dl, 0x00
out dx, al ; Set Mode
pop rdx
mov rax, gGDTPtr
mov rcx, gGDT
mov QWORD [rax+2], rcx
- lidt [rax]
+ lgdt [rax]
; Start interrupts
sti
*
* Virtual Memory Manager
*/
-#define DEBUG 1
+#define DEBUG 0
#include <acess.h>
#include <mm_virt.h>
#include <threads_int.h>
\r
// Check the file type\r
if(hdr.ident[0] != 0x7F || hdr.ident[1] != 'E' || hdr.ident[2] != 'L' || hdr.ident[3] != 'F') {\r
- Warning("Non-ELF File was passed to the ELF loader\n");\r
+ Log_Warning("ELF", "Non-ELF File was passed to the ELF loader");\r
LEAVE('n');\r
return NULL;\r
}\r
// Check for a program header\r
if(hdr.phoff == 0) {\r
#if DEBUG_WARN\r
- Warning("ELF File does not contain a program header\n");\r
+ Log_Warning("ELF", "File does not contain a program header (phoff == 0)");\r
#endif\r
LEAVE('n');\r
return NULL;\r
// Reallocate\r
ret = realloc( ret, sizeof(tBinary) + 3*sizeof(Uint)*j );\r
if(!ret) {\r
- Warning("BIN", "ElfLoad: Unable to reallocate return structure");\r
+ Log_Warning("BIN", "ElfLoad: Unable to reallocate return structure");\r
return NULL;\r
}\r
ret->NumPages = j;\r
#include <errno.h>
#include <semaphore.h>
-#define USE_CTRL_ALT 1
-
// === CONSTANTS ===
#define VERSION ((0<<8)|(50))
#define VT_FLAG_HIDECSR 0x01
#define VT_FLAG_ALTBUF 0x02 //!< Alternate screen buffer
+#define VT_FLAG_RAWIN 0x04 //!< Don't handle ^Z/^C/^V
#define VT_FLAG_HASFB 0x10 //!< Set if the VTerm has requested the Framebuffer
enum eVT_InModes {
}
/**
- * \fn Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
* \brief Read from a virtual terminal
*/
Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer)
// Other - UCS-4
default:
VFS_SelectNode(Node, VFS_SELECT_READ, NULL, "VT_Read (UCS-4)");
-
+
avail = term->InputWrite - term->InputRead;
if(avail < 0)
avail += MAX_INPUT_CHARS32;
Codepoint &= 0x7FFFFFFF;
switch(Codepoint)
{
- #if !USE_CTRL_ALT
- case KEY_RSHIFT: gbVT_CtrlDown = 0; break;
- case KEY_LSHIFT: gbVT_AltDown = 0; break;
- #else
case KEY_LALT: gbVT_AltDown &= ~1; break;
case KEY_RALT: gbVT_AltDown &= ~2; break;
case KEY_LCTRL: gbVT_CtrlDown &= ~1; break;
case KEY_RCTRL: gbVT_CtrlDown &= ~2; break;
- #endif
}
return;
}
switch(Codepoint)
{
- #if !USE_CTRL_ALT // HACK: Use both shifts instead of Ctrl-Alt
- case KEY_RSHIFT: gbVT_CtrlDown = 1; break;
- case KEY_LSHIFT: gbVT_AltDown = 1; break;
- #else
case KEY_LALT: gbVT_AltDown |= 1; break;
case KEY_RALT: gbVT_AltDown |= 2; break;
case KEY_LCTRL: gbVT_CtrlDown |= 1; break;
case KEY_RCTRL: gbVT_CtrlDown |= 2; break;
- #endif
default:
if(!gbVT_AltDown || !gbVT_CtrlDown)
// Unprintable / Don't Pass
return;
}
+
+#if 0
+ // Handle meta characters
+ if( !(term->Flags & VT_FLAG_RAWIN) )
+ {
+ switch(buf[0])
+ {
+ case '\3': // ^C
+
+ break;
+ }
+ }
+#endif
// Write
if( MAX_INPUT_CHARS8 - term->InputWrite >= len )