diff --git a/elks/arch/i86/drivers/char/console-direct.c b/elks/arch/i86/drivers/char/console-direct.c index 289e68e97..6f623207b 100644 --- a/elks/arch/i86/drivers/char/console-direct.c +++ b/elks/arch/i86/drivers/char/console-direct.c @@ -105,7 +105,7 @@ static struct hw_params params[N_DEVICETYPES] = { 0x1F, 0x06, 0x19, 0x1C, 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, - }, 16, 2, 2000 + }, 16, 3, 2000 }, /* CGA */ // TODO //{ 0 }, /* EGA */ diff --git a/elks/arch/i86/drivers/char/kbd-poll.c b/elks/arch/i86/drivers/char/kbd-poll.c index be3e3ce17..6c8bcc1ae 100644 --- a/elks/arch/i86/drivers/char/kbd-poll.c +++ b/elks/arch/i86/drivers/char/kbd-poll.c @@ -28,11 +28,11 @@ static void kbd_timer(int data) else { dav = (dav >> 8) & 0xFF; #ifndef CONFIG_CONSOLE_HEADLESS - if (dav >= 0x3B && dav <= 0x3D) { /* temp console switch on F1-F3*/ + if (dav >= 0x3B && dav <= 0x3E) { /* temp console switch on F1-F4*/ Console_set_vc(dav - 0x3B); dav = 0; } - else if ((dav >= 0x68) && (dav < 0x6B)) { /* Change VC */ + else if ((dav >= 0x68) && (dav < 0x6C)) { /* Change VC */ Console_set_vc(dav - 0x68); dav = 0; } diff --git a/elks/arch/i86/drivers/char/kbd-scancode.c b/elks/arch/i86/drivers/char/kbd-scancode.c index 9a4d23096..4782be4e0 100644 --- a/elks/arch/i86/drivers/char/kbd-scancode.c +++ b/elks/arch/i86/drivers/char/kbd-scancode.c @@ -275,8 +275,8 @@ static void keyboard_irq(int irq, struct pt_regs *regs) /* F11 and F12 function keys need 89 byte table like keys-de.h */ /* function keys are not posix standard here */ - /* AltF1-F3 are console switch*/ - if ((ModeState & ALT) && code <= SCAN_F1+2) { + /* AltF1-F4 are console switch*/ + if ((ModeState & ALT) && code <= SCAN_F1+3) { Console_set_vc(code - SCAN_F1); return; } @@ -354,8 +354,8 @@ static void keyboard_irq(int irq, struct pt_regs *regs) /* Step 6: Modify keyboard character based on some special states*/ if ((ModeState & (CTRL|ALT)) == ALT) { - /* Alt-1 - Alt-3 are also console switch (for systems w/no fnkeys)*/ - if (key >= '1' && key <= '3') { + /* Alt-1 - Alt-4 are also console switch (for systems w/no fnkeys)*/ + if (key >= '1' && key <= '4') { Console_set_vc(key - '1'); return; } diff --git a/elks/fs/msdos/inode.c b/elks/fs/msdos/inode.c index 152184c77..9d621ea65 100644 --- a/elks/fs/msdos/inode.c +++ b/elks/fs/msdos/inode.c @@ -51,6 +51,7 @@ struct msdos_devdir_entry devnods[DEVDIR_SIZE] = { { "tty1", S_IFCHR | 0644, MKDEV(TTY_MAJOR, 0) }, { "tty2", S_IFCHR | 0644, MKDEV(TTY_MAJOR, 1) }, { "tty3", S_IFCHR | 0644, MKDEV(TTY_MAJOR, 2) }, + { "tty4", S_IFCHR | 0644, MKDEV(TTY_MAJOR, 3) }, { "ttyS0", S_IFCHR | 0644, MKDEV(TTY_MAJOR, 64) }, { "ttyS1", S_IFCHR | 0644, MKDEV(TTY_MAJOR, 65) }, { "console",S_IFCHR | 0600, MKDEV(TTY_MAJOR, 254) }, diff --git a/elks/include/linuxmt/devnum.h b/elks/include/linuxmt/devnum.h index 1fc116a80..927cc6a9f 100644 --- a/elks/include/linuxmt/devnum.h +++ b/elks/include/linuxmt/devnum.h @@ -27,6 +27,7 @@ #define DEV_TTY1 MKDEV(TTY_MAJOR, 0) #define DEV_TTY2 MKDEV(TTY_MAJOR, 1) #define DEV_TTY3 MKDEV(TTY_MAJOR, 2) +#define DEV_TTY4 MKDEV(TTY_MAJOR, 3) #define DEV_TTYS0 MKDEV(TTY_MAJOR, 64) #define DEV_TTYS1 MKDEV(TTY_MAJOR, 65) diff --git a/elks/include/linuxmt/msdos_fs_sb.h b/elks/include/linuxmt/msdos_fs_sb.h index dba509577..09876f40b 100644 --- a/elks/include/linuxmt/msdos_fs_sb.h +++ b/elks/include/linuxmt/msdos_fs_sb.h @@ -45,7 +45,7 @@ struct msdos_sb_info { /* space in struct super_block is 28 bytes */ #endif #ifdef CONFIG_FS_DEV -#define DEVDIR_SIZE 44 /* # entries in FAT device table */ +#define DEVDIR_SIZE 45 /* # entries in FAT device table */ #define DEVINO_BASE (MSDOS_DPB*2) /* (DEVDIR_SIZE+MSDOS_DBP-1) & ~(MSDOS_DBP-1) */ struct msdos_devdir_entry { diff --git a/elks/include/linuxmt/ntty.h b/elks/include/linuxmt/ntty.h index 3d7f40a02..c918d0a05 100644 --- a/elks/include/linuxmt/ntty.h +++ b/elks/include/linuxmt/ntty.h @@ -23,7 +23,7 @@ /* Predefined maximum number of tty character devices */ -#define MAX_CONSOLES 3 +#define MAX_CONSOLES 4 #define MAX_PTYS 4 #define TTY_MINOR_OFFSET 0 diff --git a/elks/init/main.c b/elks/init/main.c index 3c1d39b1e..f48ba8b36 100644 --- a/elks/init/main.c +++ b/elks/init/main.c @@ -323,6 +323,7 @@ static struct dev_name_struct { { "tty1", DEV_TTY1 }, { "tty2", DEV_TTY2 }, { "tty3", DEV_TTY3 }, + { "tty4", DEV_TTY4 }, { NULL, 0 } }; diff --git a/elkscmd/rootfs_template/bin/sys b/elkscmd/rootfs_template/bin/sys index 7f78d6af2..b13a0dbea 100755 --- a/elkscmd/rootfs_template/bin/sys +++ b/elkscmd/rootfs_template/bin/sys @@ -54,6 +54,7 @@ create_dev_dir() mknod $MNT/dev/rd1 b 1 1 mknod $MNT/dev/tty2 c 4 1 mknod $MNT/dev/tty3 c 4 2 + mknod $MNT/dev/tty4 c 4 3 mknod $MNT/dev/ttyS2 c 4 66 mknod $MNT/dev/ttyS3 c 4 67 mknod $MNT/dev/ttyp1 c 4 9 diff --git a/elkscmd/rootfs_template/etc/inittab b/elkscmd/rootfs_template/etc/inittab index 5ffffa1e4..355ea5c54 100644 --- a/elkscmd/rootfs_template/etc/inittab +++ b/elkscmd/rootfs_template/etc/inittab @@ -10,10 +10,11 @@ si::sysinit:/etc/rc.sys # 2 single user ttyS0 only # 3 multiuser tty1 and ttyS0 # 4 multiuser serial only (ttyS0,ttyS1) -# 5 multiuser console only (tty1,tty2,tty3) +# 5 multiuser console only (tty1,tty2,tty3,tty4) # 6 multiuser console and serial t1:1356:respawn:/bin/getty /dev/tty1 t2:56:respawn:/bin/getty /dev/tty2 t3:56:respawn:/bin/getty /dev/tty3 +t4:56:respawn:/bin/getty /dev/tty4 s0:2346:respawn:/bin/getty /dev/ttyS0 s1:46:respawn:/bin/getty /dev/ttyS1 9600 diff --git a/image/Make.devices b/image/Make.devices index 4146f3421..674f0f72a 100755 --- a/image/Make.devices +++ b/image/Make.devices @@ -86,6 +86,7 @@ devices: $(MKDEV) /dev/tty1 c 4 0 $(MKDEV) /dev/tty2 c 4 1 $(MKDEV) /dev/tty3 c 4 2 + $(MKDEV) /dev/tty4 c 4 3 # Pseudo-TTY slave devices. diff --git a/libc/misc/devname.c b/libc/misc/devname.c index 7c9c7988b..57507f636 100644 --- a/libc/misc/devname.c +++ b/libc/misc/devname.c @@ -38,6 +38,7 @@ static struct dev_name_struct { { "tty1", S_IFCHR, DEV_TTY1 }, { "tty2", S_IFCHR, DEV_TTY2 }, { "tty3", S_IFCHR, DEV_TTY3 }, + { "tty4", S_IFCHR, DEV_TTY4 }, }; static char *__fast_devname(dev_t dev, mode_t type)