Compare commits
No commits in common. "8ddab05ed3b12ce5b0560b59145472cc050ca620" and "940fb0d1fdcbdc05121f858c715f4e11f3ccd9cc" have entirely different histories.
8ddab05ed3
...
940fb0d1fd
|
@ -44,8 +44,6 @@ namespace Kernel
|
|||
virtual BAN::ErrorOr<void> chmod_impl(mode_t) override;
|
||||
virtual BAN::ErrorOr<void> chown_impl(uid_t, gid_t) override;
|
||||
|
||||
virtual BAN::ErrorOr<long> ioctl_impl(int, void*) override;
|
||||
|
||||
virtual bool can_read_impl() const override { return m_output.flush; }
|
||||
virtual bool can_write_impl() const override { return true; }
|
||||
virtual bool has_error_impl() const override { return false; }
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <stropts.h>
|
||||
#include <sys/banan-os.h>
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
|
@ -123,22 +122,6 @@ namespace Kernel
|
|||
return {};
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> TTY::ioctl_impl(int request, void* argument)
|
||||
{
|
||||
switch (request)
|
||||
{
|
||||
case KD_LOADFONT:
|
||||
{
|
||||
auto absolute_path = TRY(Process::current().absolute_path_of(BAN::StringView(reinterpret_cast<const char*>(argument))));
|
||||
auto new_font = TRY(LibFont::Font::load(absolute_path));
|
||||
set_font(new_font);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return BAN::Error::from_errno(EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
void TTY::on_key_event(LibInput::KeyEvent event)
|
||||
{
|
||||
LockGuard _(m_mutex);
|
||||
|
|
|
@ -1,6 +1,61 @@
|
|||
set(USERSPACE_PROJECTS
|
||||
cat
|
||||
cat-mmap
|
||||
chmod
|
||||
cp
|
||||
dd
|
||||
dhcp-client
|
||||
echo
|
||||
getopt
|
||||
http-server
|
||||
id
|
||||
image
|
||||
init
|
||||
loadkeys
|
||||
ls
|
||||
meminfo
|
||||
mkdir
|
||||
nslookup
|
||||
poweroff
|
||||
resolver
|
||||
rm
|
||||
Shell
|
||||
sleep
|
||||
snake
|
||||
stat
|
||||
sudo
|
||||
sync
|
||||
tee
|
||||
Terminal
|
||||
test
|
||||
test-framebuffer
|
||||
test-globals
|
||||
test-mmap-shared
|
||||
test-mouse
|
||||
test-popen
|
||||
test-sort
|
||||
test-tcp
|
||||
test-udp
|
||||
test-unix-socket
|
||||
test-window
|
||||
touch
|
||||
u8sum
|
||||
whoami
|
||||
WindowServer
|
||||
yes
|
||||
)
|
||||
|
||||
add_subdirectory(libraries)
|
||||
|
||||
add_custom_target(userspace)
|
||||
|
||||
#add_subdirectory(aoc2023)
|
||||
add_subdirectory(libraries)
|
||||
add_subdirectory(programs)
|
||||
add_subdirectory(tests)
|
||||
|
||||
foreach(project ${USERSPACE_PROJECTS})
|
||||
add_subdirectory(${project})
|
||||
add_dependencies(userspace ${project})
|
||||
# This is to allow cmake to link when libc updates
|
||||
target_link_options(${project} PRIVATE -nolibc)
|
||||
# Default compile options
|
||||
target_compile_options(${project} PRIVATE -g -O2)
|
||||
endforeach()
|
||||
|
|
|
@ -101,8 +101,6 @@ struct str_list
|
|||
#define I_SWROPT 28
|
||||
#define I_UNLINK 29
|
||||
|
||||
#define KD_LOADFONT 30
|
||||
|
||||
#define FLUSHR 1
|
||||
#define FLUSHRW 2
|
||||
#define FLUSHW 3
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
set(USERSPACE_PROGRAMS
|
||||
cat
|
||||
cat-mmap
|
||||
chmod
|
||||
cp
|
||||
dd
|
||||
dhcp-client
|
||||
echo
|
||||
getopt
|
||||
http-server
|
||||
id
|
||||
image
|
||||
init
|
||||
loadfont
|
||||
loadkeys
|
||||
ls
|
||||
meminfo
|
||||
mkdir
|
||||
nslookup
|
||||
poweroff
|
||||
resolver
|
||||
rm
|
||||
Shell
|
||||
sleep
|
||||
snake
|
||||
stat
|
||||
sudo
|
||||
sync
|
||||
tee
|
||||
Terminal
|
||||
touch
|
||||
u8sum
|
||||
whoami
|
||||
WindowServer
|
||||
yes
|
||||
)
|
||||
|
||||
foreach(project ${USERSPACE_PROGRAMS})
|
||||
add_subdirectory(${project})
|
||||
add_dependencies(userspace ${project})
|
||||
# This is to allow cmake to link when libc updates
|
||||
target_link_options(${project} PRIVATE -nolibc)
|
||||
# Default compile options
|
||||
target_compile_options(${project} PRIVATE -g -O2)
|
||||
endforeach()
|
|
@ -1,9 +0,0 @@
|
|||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(loadfont ${SOURCES})
|
||||
banan_link_library(loadfont ban)
|
||||
banan_link_library(loadfont libc)
|
||||
|
||||
install(TARGETS loadfont)
|
|
@ -1,30 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stropts.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int usage(int ret, const char* argv0)
|
||||
{
|
||||
FILE* fout = ret ? stderr : stdout;
|
||||
fprintf(fout, "usage: %s FILE\n", argv0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
return usage(1, argv[0]);
|
||||
|
||||
if (!isatty(STDOUT_FILENO))
|
||||
{
|
||||
fprintf(stderr, "stdout is not tty\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ioctl(STDOUT_FILENO, KD_LOADFONT, argv[1]) == -1)
|
||||
{
|
||||
perror("ioctl");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
set(TEST_SOURCES
|
||||
test.cpp
|
||||
)
|
||||
|
||||
add_executable(test ${TEST_SOURCES})
|
||||
banan_link_library(test libc)
|
||||
|
||||
install(TARGETS test OPTIONAL)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue