base: apply Red Bear patches on latest upstream/main

251 files: init, acpid, ipcd, netcfg, ihdgd, virtio-gpud, scheme-utils,
inputd, block driver, ptyd, ramfs, randd, initfs bootstrap, path deps,
version +rb0.3.1, author attribution
This commit is contained in:
Red Bear OS
2026-07-11 11:39:24 +03:00
parent 1b17b3fc24
commit bd595851e2
251 changed files with 24641 additions and 5993 deletions
+66 -2
View File
@@ -314,7 +314,7 @@ mod keymaps {
(orbclient::K_BRACE_OPEN, ['è', 'é']),
(orbclient::K_BRACE_CLOSE, ['+', '*']),
(orbclient::K_ENTER, ['\0', '\0']),
(orbclient::K_CTRL, ['\0', '\0']),
(orbclient::K_CTRL, ['\x20', '\x20']),
(orbclient::K_A, ['a', 'A']),
(orbclient::K_S, ['s', 'S']),
(orbclient::K_D, ['d', 'D']),
@@ -340,6 +340,66 @@ mod keymaps {
(orbclient::K_SLASH, ['-', '_']),
(orbclient::K_SPACE, [' ', ' ']),
];
// Russian (ЙЦУКЕН) — standard JCUKEN layout (Cyrillic).
// Reference: Linux 7.x `drivers/input/keyboard/cypress_bluetooth.c` and
// `drivers/tty/vt/keymap.c` (Russian transliteration tables).
// Scancodes follow PS/2 set 1 (matching K_* constants).
pub static RU: [(u8, [char; 2]); 53] = [
(orbclient::K_ESC, ['\0', '\0']),
(orbclient::K_1, ['1', '!']),
(orbclient::K_2, ['2', '"']),
(orbclient::K_3, ['3', '№']),
(orbclient::K_4, ['4', ';']),
(orbclient::K_5, ['5', '%']),
(orbclient::K_6, ['6', ':']),
(orbclient::K_7, ['7', '?']),
(orbclient::K_8, ['8', '*']),
(orbclient::K_9, ['9', '(']),
(orbclient::K_0, ['0', ')']),
(orbclient::K_MINUS, ['-', '_']),
(orbclient::K_EQUALS, ['=', '+']),
(orbclient::K_BKSP, ['\0', '\0']),
(orbclient::K_TAB, ['\0', '\0']),
(orbclient::K_Q, ['й', 'Й']),
(orbclient::K_W, ['ц', 'Ц']),
(orbclient::K_E, ['у', 'У']),
(orbclient::K_R, ['к', 'К']),
(orbclient::K_T, ['е', 'Е']),
(orbclient::K_Y, ['н', 'Н']),
(orbclient::K_U, ['г', 'Г']),
(orbclient::K_I, ['ш', 'Ш']),
(orbclient::K_O, ['щ', 'Щ']),
(orbclient::K_P, ['з', 'З']),
(orbclient::K_BRACE_OPEN, ['х', 'Х']),
(orbclient::K_BRACE_CLOSE, ['ъ', 'Ъ']),
(orbclient::K_ENTER, ['\0', '\0']),
(orbclient::K_CTRL, ['\0', '\0']),
(orbclient::K_A, ['ф', 'Ф']),
(orbclient::K_S, ['ы', 'Ы']),
(orbclient::K_D, ['в', 'В']),
(orbclient::K_F, ['а', 'А']),
(orbclient::K_G, ['п', 'П']),
(orbclient::K_H, ['р', 'Р']),
(orbclient::K_J, ['о', 'О']),
(orbclient::K_K, ['л', 'Л']),
(orbclient::K_L, ['д', 'Д']),
(orbclient::K_SEMICOLON, ['ж', 'Ж']),
(orbclient::K_QUOTE, ['э', 'Э']),
(orbclient::K_TICK, ['ё', 'Ё']),
(orbclient::K_BACKSLASH, ['\\', '/']),
(orbclient::K_Z, ['я', 'Я']),
(orbclient::K_X, ['ч', 'Ч']),
(orbclient::K_C, ['с', 'С']),
(orbclient::K_V, ['м', 'М']),
(orbclient::K_B, ['и', 'И']),
(orbclient::K_N, ['т', 'Т']),
(orbclient::K_M, ['ь', 'Ь']),
(orbclient::K_COMMA, ['б', 'Б']),
(orbclient::K_PERIOD, ['ю', 'Ю']),
(orbclient::K_SLASH, ['.', ',']),
(orbclient::K_SPACE, [' ', ' ']),
];
}
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -351,11 +411,12 @@ pub enum KeymapKind {
Azerty,
Bepo,
IT,
RU,
}
impl From<usize> for KeymapKind {
fn from(value: usize) -> Self {
if value > (KeymapKind::IT as usize) {
if value > (KeymapKind::RU as usize) {
KeymapKind::US
} else {
// SAFETY: Checked above
@@ -379,6 +440,7 @@ impl FromStr for KeymapKind {
"azerty" => KeymapKind::Azerty,
"bepo" => KeymapKind::Bepo,
"it" => KeymapKind::IT,
"ru" => KeymapKind::RU,
&_ => return Err(ParseKeymapError(())),
};
@@ -395,6 +457,7 @@ impl Display for KeymapKind {
KeymapKind::Azerty => "azerty",
KeymapKind::Bepo => "bepo",
KeymapKind::IT => "it",
KeymapKind::RU => "ru",
};
f.write_str(s)
}
@@ -414,6 +477,7 @@ impl KeymapData {
KeymapKind::Azerty => HashMap::from(keymaps::AZERTY),
KeymapKind::Bepo => HashMap::from(keymaps::BEPO),
KeymapKind::IT => HashMap::from(keymaps::IT),
KeymapKind::RU => HashMap::from(keymaps::RU),
};
Self { keymap_hash, kind }
+3 -2
View File
@@ -205,8 +205,9 @@ impl ProducerHandle {
}
pub fn write_event(&mut self, event: orbclient::Event) -> io::Result<()> {
let amount = self.0.write(&event)?;
assert!(amount == core::mem::size_of::<orbclient::Event>());
let written = self.0.write(&event)?;
assert_eq!(written, std::mem::size_of::<orbclient::Event>() as usize,
"write_event: short write ({} != {})", written, std::mem::size_of::<orbclient::Event>());
Ok(())
}
}
+10 -16
View File
@@ -383,7 +383,11 @@ impl SchemeSync for InputScheme {
log::error!("display tried to write");
return Err(SysError::new(EINVAL));
}
Handle::Producer => {}
Handle::Producer { .. } => {
// Producers send input events TO the inputd daemon, not the
// other way around. Writing to a Producer handle is invalid.
return Err(SysError::new(EINVAL));
}
Handle::SchemeRoot => return Err(SysError::new(EBADF)),
}
@@ -429,18 +433,6 @@ impl SchemeSync for InputScheme {
}
},
// Set ID for controller events
EventOption::ControllerAxis(mut axis_event) => {
//TODO: what to do with overflow?
axis_event.id = id as u32;
events.to_mut()[i] = axis_event.to_event();
}
EventOption::ControllerButton(mut button_event) => {
//TODO: what to do with overflow?
button_event.id = id as u32;
events.to_mut()[i] = button_event.to_event();
}
_ => continue,
}
@@ -533,7 +525,7 @@ impl SchemeSync for InputScheme {
}
}
fn daemon(daemon: daemon::SchemeDaemon) -> anyhow::Result<()> {
fn deamon(daemon: daemon::SchemeDaemon) -> anyhow::Result<()> {
// Create the ":input" scheme.
let socket_file = Socket::create()?;
let mut scheme = InputScheme::new();
@@ -600,8 +592,8 @@ fn daemon(daemon: daemon::SchemeDaemon) -> anyhow::Result<()> {
}
}
fn daemon_runner(redox_daemon: daemon::SchemeDaemon) -> ! {
daemon(redox_daemon).unwrap();
fn daemon_runner(daemon: daemon::SchemeDaemon) -> ! {
deamon(daemon).unwrap();
unreachable!();
}
@@ -670,6 +662,8 @@ fn main() {
common::file_level(),
);
log::info!("inputd: scheme:input registered, waiting for handles");
daemon::SchemeDaemon::new(daemon_runner);
}
}