repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
willmexe/opuntiaOS | boot/libboot/log/log.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _BOOT_LIBBOOT_LOG_LOG_H
#define _BOOT_LIBBOOT_LOG_LOG_H
#include <libboot/types.h>
typedef int (*ua... |
willmexe/opuntiaOS | libs/libipc/include/libipc/Decodable.h | #pragma once
#include <cstddef>
template <typename T>
class Decodable {
public:
virtual void decode(const char* buf, size_t& offset) { }
}; |
willmexe/opuntiaOS | kernel/include/mem/vm_alloc.h | <gh_stars>0
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_MEM_VM_ALLOC_H
#define _KERNEL_MEM_VM_ALLOC_H
#include <libkern/libkern.h>
#incl... |
willmexe/opuntiaOS | kernel/include/platform/generic/system.h | #ifdef __i386__
#include <platform/x86/system.h>
#elif __arm__
#include <platform/aarch32/system.h>
#endif |
willmexe/opuntiaOS | kernel/include/libkern/syscall_structs.h | #ifndef _KERNEL_LIBKERN_SYSCALL_STRUCTS_H
#define _KERNEL_LIBKERN_SYSCALL_STRUCTS_H
#include <libkern/bits/fcntl.h>
#include <libkern/bits/sys/ioctls.h>
#include <libkern/bits/sys/mman.h>
#include <libkern/bits/sys/select.h>
#include <libkern/bits/sys/socket.h>
#include <libkern/bits/sys/stat.h>
#include <libkern/bits... |
willmexe/opuntiaOS | kernel/include/drivers/x86/display.h | <filename>kernel/include/drivers/x86/display.h
#ifndef _KERNEL_DRIVERS_X86_DISPLAY_H
#define _KERNEL_DRIVERS_X86_DISPLAY_H
#include <libkern/libkern.h>
#include <libkern/types.h>
#include <platform/x86/memmap.h>
#include <platform/x86/port.h>
#define VIDEO_MEMORY (char*)(0xb8000 + BIOS_SETTING_BASE)
#define VIDEO_ADD... |
willmexe/opuntiaOS | libs/libc/socket/socket.c | #include <sys/socket.h>
#include <sysdep.h>
int socket(int domain, int type, int protocol)
{
int res = DO_SYSCALL_3(SYS_SOCKET, domain, type, protocol);
RETURN_WITH_ERRNO(res, res, -1);
}
int bind(int sockfd, const char* name, int len)
{
int res = DO_SYSCALL_3(SYS_BIND, sockfd, name, len);
RETURN_WITH... |
willmexe/opuntiaOS | kernel/include/mem/bits/mmu.h | <filename>kernel/include/mem/bits/mmu.h<gh_stars>0
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_MEM_BITS_MMU_H
#define _KERNEL_MEM_BITS_MM... |
willmexe/opuntiaOS | libs/libc/time/strftime.c | <reponame>willmexe/opuntiaOS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sysdep.h>
#include <time.h>
static const char __wday_snames[7][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static const char __wday_lnames[7][11] = {
"Sunday", "Monday", "Tuesda... |
willmexe/opuntiaOS | libs/libfoundation/include/libfoundation/helpers/LoggerStreamBuf.h | #include <__std_streambuffer>
namespace LFoundation::Logger {
class StreamBuf : public std::__stdoutbuf<char> {
public:
StreamBuf(FILE* file)
: __stdoutbuf<char>(file)
{
}
~StreamBuf() = default;
};
} // namespace LFoundation::Logger
|
willmexe/opuntiaOS | libs/libc/sysdeps/opuntiaos/generic/shared_buffer.c | #include <opuntia/shared_buffer.h>
#include <sysdep.h>
int shared_buffer_create(uint8_t** buffer, size_t size)
{
int res = DO_SYSCALL_2(SYS_SHBUF_CREATE, buffer, size);
RETURN_WITH_ERRNO(res, res, res);
}
int shared_buffer_get(int id, uint8_t** buffer)
{
int res = DO_SYSCALL_2(SYS_SHBUF_GET, id, buffer);
... |
willmexe/opuntiaOS | test/kernel/fs/fourfiles/main.c | <reponame>willmexe/opuntiaOS<filename>test/kernel/fs/fourfiles/main.c
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
char buf[512];
int main(int argc, char** argv)
{
int fd, pid, i, j, n, total, pi;
char* names[] = { "f0.e", "f1.e", "f2... |
willmexe/opuntiaOS | kernel/include/libkern/_types/_va_list.h | #ifndef _KERNEL_LIBKERN__TYPES__VA_LIST_H
#define _KERNEL_LIBKERN__TYPES__VA_LIST_H
typedef __builtin_va_list va_list;
#endif // _KERNEL_LIBKERN__TYPES__VA_LIST_H |
willmexe/opuntiaOS | boot/libboot/mem/malloc.h | <gh_stars>0
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _BOOT_LIBBOOT_MEM_MALLOC_H
#define _BOOT_LIBBOOT_MEM_MALLOC_H
#include <libboot/mem/mem.... |
willmexe/opuntiaOS | libs/libc/posix/tasking.c | #include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysdep.h>
#include <unistd.h>
int fork()
{
int res = DO_SYSCALL_0(SYS_FORK);
RETURN_WITH_ERRNO(res, res, -1);
}
int execve(const char* path, char* const argv[], char* const envp[])
{
int res = DO_SYSCALL_3(SYS_EXECVE,... |
willmexe/opuntiaOS | kernel/include/platform/generic/tasking/context.h | <reponame>willmexe/opuntiaOS
#ifdef __i386__
#include <platform/x86/tasking/context.h>
#elif __arm__
#include <platform/aarch32/tasking/context.h>
#endif |
willmexe/opuntiaOS | libs/libc/include/sys/wait.h | #ifndef _LIBC_SYS_WAIT_H
#define _LIBC_SYS_WAIT_H
#include <bits/sys/wait.h>
#include <fcntl.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int wait(int pid);
int waitpid(int pid, int* status, int options);
__END_DECLS
#endif // _LIBC_SYS_WAIT_H |
willmexe/opuntiaOS | kernel/kernel/syscalls/fs.c | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <libkern/bits/errno.h>
#include <libkern/libkern.h>
#include <libkern/log.h>
#include <mem/kmalloc.h... |
willmexe/opuntiaOS | kernel/include/tasking/bits/dump.h | <filename>kernel/include/tasking/bits/dump.h<gh_stars>100-1000
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_TASKING_BITS_DUMP_H
#define _K... |
willmexe/opuntiaOS | libs/libc/stdlib/tools.c | <filename>libs/libc/stdlib/tools.c
#include <stdlib.h>
#include <string.h>
int atoi(const char* s)
{
// FIXME: Add overflow checks
int res = 0;
int len = strlen(s);
int mul = 1;
for (int i = 0; i < len; i++) {
mul *= 10;
}
for (int i = 0; i < len; i++) {
mul /= 10;
r... |
willmexe/opuntiaOS | libs/libc/malloc/slab.c | #include "malloc.h"
#include <stdbool.h>
#include <string.h>
#include <sys/mman.h>
// Fast allocator for sizes 16, 32, 48, 64 bytes
malloc_header_t* free_blocks[5];
void prepare_free_blocks(size_t size)
{
int block_id = size >> 4;
const size_t alloc_size = MALLOC_DEFAULT_BLOCK_SIZE;
int ret = (int)mmap(N... |
willmexe/opuntiaOS | kernel/kernel/drivers/x86/display.c | <filename>kernel/kernel/drivers/x86/display.c
#include <drivers/x86/display.h>
#include <drivers/x86/uart.h>
// prints
void ext_print_char(char symbol, unsigned char color, int col, int row, int minus_offset)
{
char* mem = VIDEO_MEMORY;
unsigned short offset_types[2] = { get_cursor_offet(), get_offset... |
willmexe/opuntiaOS | kernel/include/drivers/generic/uart.h | #ifdef __i386__
#include <drivers/x86/uart.h>
#elif __arm__
#include <drivers/aarch32/uart.h>
#endif |
willmexe/opuntiaOS | libs/libc/include/string.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
* + Contributed by bellrise <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _LIBC_STRING_H
#define _LIBC_STRING_H
#include <stddef.h>
#in... |
willmexe/opuntiaOS | kernel/kernel/tasking/elf.c | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <fs/vfs.h>
#include <libkern/bits/errno.h>
#include <libkern/libkern.h>
#include <libkern/log.h>
#in... |
willmexe/opuntiaOS | kernel/include/mem/bits/swap.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_MEM_BITS_SWAP_H
#define _KERNEL_MEM_BITS_SWAP_H
enum SWAP_TYPE {
SWAP_TO_DEV,
SWAP_D... |
willmexe/opuntiaOS | userland/tests/sigtest/main.c | #include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void save_on_terminate()
{
printf("Saving file and exiting");
fflush(stdout);
}
int main(int argc, char** argv)
{
sigaction(SIGTERM, save_on_terminate);
while (1) {
// infinite loop
}
retu... |
willmexe/opuntiaOS | libs/libc/pwd/shadow.c | #include <assert.h>
#include <shadow.h>
#include <stdio.h>
#include <string.h>
static FILE* spwdfile = NULL;
static char tmp_buf[512];
// spwd struct contains pointers to data which is
// stored in spwd_buf
static char spwd_buf[512];
static spwd_t spwd_entry;
static inline int spwd_part_to_int(char* part)
{
int ... |
willmexe/opuntiaOS | kernel/kernel/platform/x86/interrupts/isr_handler.c | <reponame>willmexe/opuntiaOS
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
* + Contributed by bellrise <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <drivers/x86/fpu.h>
#include <l... |
willmexe/opuntiaOS | libs/libc/include/assert.h | #ifndef _LIBC_ASSERT_H
#define _LIBC_ASSERT_H
#include <stddef.h>
#include <stdio.h>
#include <sys/_structs.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
#ifndef assert
#define assert(x) \
if (!(x)) [[unlikely]] {... |
willmexe/opuntiaOS | libs/libc/posix/identity.c | #include <assert.h>
#include <pwd.h>
#include <string.h>
#include <sysdep.h>
#include <unistd.h>
uid_t getuid()
{
return (uid_t)DO_SYSCALL_0(SYS_GETUID);
}
uid_t geteuid()
{
return 0;
}
int setuid(uid_t uid)
{
return DO_SYSCALL_1(SYS_SETUID, uid);
}
int setgid(gid_t gid)
{
return DO_SYSCALL_1(SYS_SE... |
willmexe/opuntiaOS | kernel/include/libkern/bits/sys/mman.h | #ifndef _KERNEL_LIBKERN_BITS_SYS_MMAN_H
#define _KERNEL_LIBKERN_BITS_SYS_MMAN_H
#include <libkern/types.h>
#define MAP_SHARED 0x01
#define MAP_PRIVATE 0x02
#define MAP_FIXED 0x10
#define MAP_ANONYMOUS 0x20
#define MAP_STACK 0x40
#define PROT_READ 0x1
#define PROT_WRITE 0x2
#define PROT_EXEC 0x4
#define PROT_NONE 0x0... |
willmexe/opuntiaOS | libs/libc/include/stdarg.h | <reponame>willmexe/opuntiaOS
#ifndef _LIBC_STDARG_H
#define _LIBC_STDARG_H
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
#define va_start(v, l) __builtin_va_start(v, l)
#define va_end(v) __builtin_va_end(v)
#define va_arg(v, l) __builtin_va_arg(v, l)
__END_DECLS
#endif // _LIBC_STDARG_H |
willmexe/opuntiaOS | libs/libipc/include/libipc/MessageDecoder.h | <reponame>willmexe/opuntiaOS
#pragma once
#include <libipc/Message.h>
#include <memory>
class MessageDecoder {
public:
MessageDecoder() = default;
virtual ~MessageDecoder() = default;
virtual int magic() { return 0; }
virtual std::unique_ptr<Message> decode(const char* buf, size_t size, size_t& decode... |
willmexe/opuntiaOS | kernel/include/platform/x86/gdt.h | <filename>kernel/include/platform/x86/gdt.h
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_PLATFORM_X86_GDT_H
#define _KERNEL_PLATFORM_X86_G... |
willmexe/opuntiaOS | test/kernel/fs/dup/main.c | #include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char** argv)
{
int fd = -1;
fd = open("/boot/kernel.config", O_RDONLY);
if (fd < 0) {
TestErr("Can't open kernel.config");
}
int dupfd = dup(fd);
... |
willmexe/opuntiaOS | userland/utilities/mkdir/main.c | #include <sys/stat.h>
#include <unistd.h>
int main(int argc, char** argv)
{
if (argc < 2) {
write(1, "Usage: mkdir files...\n", 22);
return 0;
}
for (int i = 1; i < argc; i++) {
if (mkdir(argv[i]) < 0) {
write(1, "mkdir: failed to create\n", 26);
return 1;
... |
willmexe/opuntiaOS | libs/libui/include/libui/ContextManager.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include <libg/Context.h>
namespace UI {
static inline void graphics_push_context(LG::Context&... |
willmexe/opuntiaOS | boot/libboot/abi/drivers.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _BOOT_LIBBOOT_ABI_DRIVERS_H
#define _BOOT_LIBBOOT_ABI_DRIVERS_H
#include <libboot/types.h>
#define ... |
willmexe/opuntiaOS | kernel/kernel/mem/swapfile.c | <gh_stars>100-1000
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <fs/vfs.h>
#include <libkern/bits/errno.h>
#include <libkern/log.h>
#include <mem... |
willmexe/opuntiaOS | servers/window_server/src/Managers/Compositor.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include "../shared/Connections/WSConnection.h"
#include "IPC/ServerDecoder.h"
#include <libipc/... |
willmexe/opuntiaOS | boot/aarch32/drivers/uart.c | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "uart.h"
#include <libboot/devtree/devtree.h>
volatile uint32_t* output = NULL;
void uart_init()
{... |
willmexe/opuntiaOS | kernel/include/platform/generic/cpu.h | <reponame>willmexe/opuntiaOS
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_TASKING_BITS_CPU_H
#define _KERNEL_TASKING_BITS_CPU_H
#include ... |
willmexe/opuntiaOS | servers/window_server/shared/Connections/WSConnection.h | <reponame>willmexe/opuntiaOS<filename>servers/window_server/shared/Connections/WSConnection.h
// Auto generated with utils/ConnectionCompiler
// See .ipc file
#pragma once
#include <libg/Rect.h>
#include <libipc/ClientConnection.h>
#include <libipc/Encoder.h>
#include <libipc/ServerConnection.h>
#include <libipc/Strin... |
willmexe/opuntiaOS | libs/libc/include/errno.h | <gh_stars>100-1000
#ifndef _LIBC_ERRNO_H
#define _LIBC_ERRNO_H
#include <bits/errno.h>
extern int errno;
#define set_errno(x) (errno = x)
#endif |
willmexe/opuntiaOS | libs/libc/posix/signal.c | <filename>libs/libc/posix/signal.c
#include <signal.h>
#include <sysdep.h>
#include <unistd.h>
int sigaction(int signo, void* callback)
{
int res = DO_SYSCALL_2(SYS_SIGACTION, signo, callback);
RETURN_WITH_ERRNO(res, 0, -1);
}
int raise(int signo)
{
return kill(getpid(), signo);
}
int kill(pid_t pid, int... |
willmexe/opuntiaOS | libs/libc/include/sys/_structs.h | <filename>libs/libc/include/sys/_structs.h
#ifndef _LIBC_SYS__STRUCTS_H
#define _LIBC_SYS__STRUCTS_H
#endif |
willmexe/opuntiaOS | kernel/kernel/algo/ringbuffer.c | <filename>kernel/kernel/algo/ringbuffer.c<gh_stars>100-1000
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <algo/ringbuffer.h>
ringbuffer_t ringbu... |
willmexe/opuntiaOS | kernel/include/platform/x86/registers.h | <filename>kernel/include/platform/x86/registers.h
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_PLATFORM_X86_REGISTERS_H
#define _KERNEL_PL... |
willmexe/opuntiaOS | libs/libc/malloc/malloc.c | #include "malloc.h"
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#define ALIGNMENT (4)
#define DEVIDE_SPACE_BOUNDARY (32)
static malloc_header_t* memory[MALLOC_MAX_ALLOCATED_BLOCKS];
static size_t allocated_blocks = 0;
static int _alloc_new_block(size_t sz);
stati... |
willmexe/opuntiaOS | libs/libipc/include/libipc/Encodable.h | #pragma once
#include <libipc/Encoder.h>
template <typename T>
class Encodable {
public:
virtual void encode(EncodedMessage& buf) const { }
}; |
willmexe/opuntiaOS | libs/libc/malloc/malloc.h | #ifndef _LIBC_MALLOC_MALLOC_H
#define _LIBC_MALLOC_MALLOC_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
#define MALLOC_DEFAULT_BLOCK_SIZE 4096
#define MALLOC_MAX_ALLOCATED_BLOCKS 64
#define FLAG_ALLOCATED (0x1)
#define FLAG_SLAB (0x2)
stru... |
willmexe/opuntiaOS | kernel/include/libkern/log.h | #ifndef _KERNEL_LIBKERN_LOG_H
#define _KERNEL_LIBKERN_LOG_H
#include <libkern/printf.h>
#include <libkern/types.h>
void logger_setup();
int log(const char* format, ...);
int log_warn(const char* format, ...);
int log_error(const char* format, ...);
int log_not_formatted(const char* format, ...);
#endif // _KERNEL_L... |
willmexe/opuntiaOS | libs/libc/include/bits/sys/mman.h | <filename>libs/libc/include/bits/sys/mman.h<gh_stars>100-1000
#ifndef _LIBC_BITS_SYS_MMAN_H
#define _LIBC_BITS_SYS_MMAN_H
#include <stddef.h>
#include <sys/types.h>
#define MAP_SHARED 0x01
#define MAP_PRIVATE 0x02
#define MAP_FIXED 0x10
#define MAP_ANONYMOUS 0x20
#define MAP_STACK 0x40
#define PROT_READ 0x1
#define ... |
willmexe/opuntiaOS | libs/libc/include/bits/sys/ptrace.h | #ifndef _LIBC_BITS_SYS_PTRACE_H
#define _LIBC_BITS_SYS_PTRACE_H
#include <stddef.h>
#include <sys/types.h>
typedef int ptrace_request_t;
#define PTRACE_TRACEME (0x1)
#define PTRACE_CONT (0x2)
#define PTRACE_PEEKTEXT (0x3)
#define PTRACE_PEEKDATA (0x4)
#endif // _LIBC_BITS_SYS_PTRACE_H |
willmexe/opuntiaOS | kernel/include/mem/vm_pspace.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_MEM_VM_PSPACE_H
#define _KERNEL_MEM_VM_PSPACE_H
#include <libkern/libkern.h>
#include <mem/b... |
willmexe/opuntiaOS | userland/utilities/edit/main.c | #include "file.h"
#include "lifetime.h"
#include "menu.h"
#include "mode.h"
#include "viewer.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define STDIN 0
#define STDOUT 1
uint32_t mode;
mode_disc_t mode_disc;
void viewing_accept_key(char key)
{
if (key == ':') {
menu_enter_mode();
... |
willmexe/opuntiaOS | libs/libc/stdlib/exit.c | <filename>libs/libc/stdlib/exit.c
#include <signal.h>
#include <stdlib.h>
#include <sysdep.h>
void exit(int status)
{
DO_SYSCALL_1(SYS_EXIT, status);
__builtin_unreachable();
}
void abort()
{
raise(SIGABRT);
exit(127);
}
|
willmexe/opuntiaOS | kernel/include/drivers/aarch32/fpuv4.h | <filename>kernel/include/drivers/aarch32/fpuv4.h<gh_stars>100-1000
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_DRIVERS_AARCH32_FPUV4_H
#d... |
willmexe/opuntiaOS | kernel/include/platform/x86/tasking/context.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_PLATFORM_X86_TASKING_CONTEXT_H
#define _KERNEL_PLATFORM_X86_TASKING_CONTEXT_H
#include <libk... |
willmexe/opuntiaOS | kernel/include/platform/aarch32/vmm/pde.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_PLATFORM_AARCH32_VMM_PDE_H
#define _KERNEL_PLATFORM_AARCH32_VMM_PDE_H
#include <libkern/c_at... |
willmexe/opuntiaOS | kernel/include/platform/generic/pmm/settings.h | #ifdef __i386__
#include <platform/x86/pmm/settings.h>
#elif __arm__
#include <platform/aarch32/pmm/settings.h>
#endif |
willmexe/opuntiaOS | userland/utilities/rm/main.c | <gh_stars>100-1000
#include <unistd.h>
int main(int argc, char** argv)
{
if (argc < 2) {
write(1, "Usage: rm files...\n", 21);
return 0;
}
for (int i = 1; i < argc; i++) {
if (unlink(argv[i]) < 0) {
write(1, "rm: failed to delete\n", 21);
break;
}
... |
willmexe/opuntiaOS | libs/libc/include/bits/sys/wait.h | #ifndef _LIBC_BITS_SYS_WAIT_H
#define _LIBC_BITS_SYS_WAIT_H
#define WNOHANG 0x1
#define WUNTRACED 0x2
#endif // _LIBC_BITS_SYS_WAIT_H |
willmexe/opuntiaOS | servers/window_server/src/Components/Popup/Popup.h | <filename>servers/window_server/src/Components/Popup/Popup.h
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include "../../Managers/Composito... |
willmexe/opuntiaOS | libs/libg/include/libg/CornerMask.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include <cstddef>
#include <sys/types.h>
namespace LG {
class CornerMask {
public:
stati... |
willmexe/opuntiaOS | kernel/include/libkern/mem.h | <filename>kernel/include/libkern/mem.h
#ifndef _KERNEL_LIBKERN_MEM_H
#define _KERNEL_LIBKERN_MEM_H
#include <libkern/types.h>
void* memset(void* dest, uint8_t fll, uint32_t nbytes);
void* memcpy(void* dest, const void* src, uint32_t nbytes);
void* memccpy(void* dest, const void* src, uint8_t stop, uint32_t nbytes);
v... |
willmexe/opuntiaOS | kernel/include/libkern/bits/syscalls.h | <gh_stars>100-1000
// Compiled with utils/legacy/syscall_parser.py
#ifndef _KERNEL_LIBKERN_BITS_SYSCALLS_H
#define _KERNEL_LIBKERN_BITS_SYSCALLS_H
#ifdef __i386__
enum __sysid {
SYS_RESTART_SYSCALL = 0,
SYS_EXIT = 1,
SYS_FORK = 2,
SYS_READ = 3,
SYS_WRITE = 4,
SYS_OPEN = 5,
SYS_CLOSE = 6,
... |
willmexe/opuntiaOS | kernel/include/platform/generic/registers.h | #ifdef __i386__
#include <platform/x86/registers.h>
#elif __arm__
#include <platform/aarch32/registers.h>
#endif |
willmexe/opuntiaOS | boot/x86/stage2/drivers/port.c | <filename>boot/x86/stage2/drivers/port.c
#include "port.h"
unsigned char port_byte_in(unsigned short port)
{
unsigned char result_data;
asm volatile("inb %%dx, %%al"
: "=a"(result_data)
: "d"(port));
return result_data;
}
void port_byte_out(unsigned short port, unsigned c... |
willmexe/opuntiaOS | kernel/include/mem/kmemzone.h | <reponame>willmexe/opuntiaOS
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_MEM_KMEMZONE_H
#define _KERNEL_MEM_KMEMZONE_H
#include <libkern... |
willmexe/opuntiaOS | kernel/include/libkern/platform.h | <filename>kernel/include/libkern/platform.h
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_LIBKERN_PLATFORM_H
#define _KERNEL_LIBKERN_PLATFO... |
willmexe/opuntiaOS | kernel/include/drivers/x86/ide.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_DRIVERS_X86_IDE_H
#define _KERNEL_DRIVERS_X86_IDE_H
#include <drivers/x86/ata.h>
#include <l... |
willmexe/opuntiaOS | kernel/include/platform/generic/tasking/signal_impl.h | <gh_stars>100-1000
#ifdef __i386__
#include <platform/x86/tasking/signal_impl.h>
#elif __arm__
#include <platform/aarch32/tasking/signal_impl.h>
#endif |
willmexe/opuntiaOS | libs/libc/include/sys/_types/_va_list.h | <reponame>willmexe/opuntiaOS<gh_stars>100-1000
#ifndef _LIBC_SYS__TYPES__VA_LIST_H
#define _LIBC_SYS__TYPES__VA_LIST_H
typedef __builtin_va_list va_list;
#endif // _LIBC_SYS__TYPES__VA_LIST_H |
willmexe/opuntiaOS | libs/libui/include/libui/Window.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include "../../../servers/window_server/shared/Connections/WSConnection.h"
#include "../../../s... |
willmexe/opuntiaOS | servers/window_server/src/Managers/WindowManager.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include "../../shared/Connections/WSConnection.h"
#include "../Components/ControlBar/ControlBar... |
willmexe/opuntiaOS | kernel/kernel/syscalls/system.c | <reponame>willmexe/opuntiaOS<filename>kernel/kernel/syscalls/system.c
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <libkern/bits/errno.h>
#includ... |
willmexe/opuntiaOS | libs/libc/include/bits/fcntl.h | #ifndef _LIBC_BITS_FCNTL_H
#define _LIBC_BITS_FCNTL_H
#define SEEK_SET 0x1
#define SEEK_CUR 0x2
#define SEEK_END 0x3
/* OPEN */
#define O_RDONLY 0x1
#define O_WRONLY 0x2
#define O_RDWR (O_RDONLY | O_WRONLY)
#define O_DIRECTORY 0x4
#define O_CREAT 0x8
#define O_TRUNC 0x10
#define O_APPEND 0x20
#define O_EXCL 0x40
#def... |
willmexe/opuntiaOS | libs/libc/include/sys/_types/_devs.h | #ifndef _LIBC_SYS__TYPES__DEVS_H
#define _LIBC_SYS__TYPES__DEVS_H
#define MINORBITS 20
#define MINORMASK ((1U << MINORBITS) - 1)
#define major(dev) ((unsigned int)((dev) >> MINORBITS))
#define minor(dev) ((unsigned int)((dev)&MINORMASK))
#define makedev(ma, mi) (((ma) << MINORBITS) | (mi))
#endif // _LIBC_SYS__TYPES_... |
willmexe/opuntiaOS | kernel/include/drivers/generic/fpu.h | <reponame>willmexe/opuntiaOS
#ifdef __i386__
#include <drivers/x86/fpu.h>
#elif __arm__
#include <drivers/aarch32/fpuv4.h>
#endif |
willmexe/opuntiaOS | kernel/include/libkern/scanf.h | <reponame>willmexe/opuntiaOS
#ifndef _KERNEL_LIBKERN_SCANF_H
#define _KERNEL_LIBKERN_SCANF_H
#include <libkern/types.h>
#define EOF (-1)
typedef int (*scanf_lookupch_callback)(void* callback_params);
typedef int (*scanf_getch_callback)(void* callback_params);
typedef int (*scanf_putch_callback)(char ch, char* buf_ba... |
willmexe/opuntiaOS | libs/libc/include/sysdep.h | <gh_stars>100-1000
#ifndef _LIBC_SYSDEP_H
#define _LIBC_SYSDEP_H
#include <bits/syscalls.h>
#include <errno.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
static inline int _syscall_impl(sysid_t sysid, int p1, int p2, int p3, int p4, int p5)
{
int ret;
#ifdef __i386__
asm volatile("push %%ebx;movl %2,%%ebx;int $0x8... |
willmexe/opuntiaOS | userland/system/dock/DockEntity.h | #pragma once
#include "WindowEntity.h"
#include <libg/PixelBitmap.h>
#include <list>
#include <string>
class DockEntity {
public:
DockEntity() = default;
void set_icon(LG::PixelBitmap&& icon) { m_icon = std::move(icon); }
const LG::PixelBitmap& icon() const { return m_icon; }
void set_path_to_exec(co... |
willmexe/opuntiaOS | boot/libboot/types.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _BOOT_LIBBOOT_TYPES_H
#define _BOOT_LIBBOOT_TYPES_H
typedef char int8_t;
typedef short int16_t;
type... |
willmexe/opuntiaOS | kernel/include/libkern/kernel_self_test.h | <filename>kernel/include/libkern/kernel_self_test.h
#ifndef _KERNEL_LIBKERN_KERNEL_SELF_TEST_H
#define _KERNEL_LIBKERN_KERNEL_SELF_TEST_H
#include <libkern/types.h>
void kpanic_at_test(char* t_err_msg, uint16_t test_no);
bool kernel_self_test(bool throw_kernel_panic);
#endif // _KERNEL_LIBKERN_KERNEL_SELF_TEST_H
|
willmexe/opuntiaOS | libs/libc/include/sys/mman.h | #ifndef _LIBC_SYS_MMAN_H
#define _LIBC_SYS_MMAN_H
#include <bits/sys/mman.h>
#include <stddef.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
void* mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset);
int munmap(void* addr, size_t length);
__END_DECLS
#endif // _LIBC_SYS_MMAN_... |
willmexe/opuntiaOS | kernel/kernel/platform/x86/gdt.c | <gh_stars>0
/*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <mem/kmalloc.h>
#include <mem/vmm.h>
#include <platform/x86/gdt.h>
#include <platform/x8... |
willmexe/opuntiaOS | boot/x86/stage2/drivers/ata.h | <gh_stars>100-1000
#ifndef _BOOT_X86_STAGE2_DRIVERS_ATA_H
#define _BOOT_X86_STAGE2_DRIVERS_ATA_H
#include "port.h"
#include <libboot/abi/drivers.h>
#include <libboot/types.h>
typedef struct { // LBA28 | LBA48
uint32_t data_port; // 16bit | 16 bits
uint32_t error_port; // 8 bit | 16 bits
uint32_t sector_co... |
willmexe/opuntiaOS | libs/libfoundation/include/libfoundation/Logger.h | <gh_stars>100-1000
#include <ostream>
namespace LFoundation::Logger {
extern std::ostream debug;
} // namespace LFoundation::Logger
namespace Logger {
using LFoundation::Logger::debug;
} // namespace Logger |
willmexe/opuntiaOS | boot/x86/stage2/drivers/ata.c | <gh_stars>100-1000
/**
* Ata Stage2 driver. This is a lite version, since it can work with
* only one drive at time. The @active_ata_drive is a boot drive.
*/
#include "ata.h"
ata_t active_ata_drive;
void init_ata(uint32_t port, char is_master)
{
active_ata_drive.is_master = is_master;
active_ata_drive.da... |
willmexe/opuntiaOS | libs/libc/termios/termios.c | #include <sys/ioctl.h>
#include <termios.h>
int tcgetpgrp(int fd)
{
return ioctl(fd, TIOCGPGRP, 0);
}
int tcsetpgrp(int fd, pid_t pgid)
{
return ioctl(fd, TIOCSPGRP, pgid);
}
int tcgetattr(int fd, termios_t* termios_p)
{
return ioctl(0, TCGETS, (int)termios_p);
}
int tcsetattr(int fd, int optional_actio... |
willmexe/opuntiaOS | libs/libc/include/setjmp.h | <filename>libs/libc/include/setjmp.h
#ifndef _LIBC_SETJMP_H
#define _LIBC_SETJMP_H
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
#ifdef __i386__
/**
* x86_32 (6 * 4):
* - ebx
* - esp
* - ebp
* - esi
* - edi
* - return address
*/
#define _jblen (6 * 4)
#elif defined(__arm__) && defin... |
willmexe/opuntiaOS | libs/libipc/include/libipc/ClientConnection.h | #pragma once
#include <cstdlib>
#include <libfoundation/Event.h>
#include <libfoundation/EventLoop.h>
#include <libfoundation/EventReceiver.h>
#include <libfoundation/Logger.h>
#include <libipc/Message.h>
#include <libipc/MessageDecoder.h>
#include <unistd.h>
#include <vector>
template <typename ServerDecoder, typenam... |
willmexe/opuntiaOS | libs/libfoundation/include/libfoundation/json/Parser.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#pragma once
#include <libfoundation/json/Lexer.h>
#include <libfoundation/json/Object.h>
#include <string>
... |
willmexe/opuntiaOS | kernel/include/libkern/bits/sys/ioctls.h | <reponame>willmexe/opuntiaOS
#ifndef _KERNEL_LIBKERN_BITS_SYS_IOCTLS_H
#define _KERNEL_LIBKERN_BITS_SYS_IOCTLS_H
/* TTY */
#define TIOCGPGRP 0x0101
#define TIOCSPGRP 0x0102
#define TCGETS 0x0103
#define TCSETS 0x0104
#define TCSETSW 0x0105
#define TCSETSF 0x0106
/* BGA */
#define BGA_SWAP_BUFFERS 0x0101
#define BGA_G... |
willmexe/opuntiaOS | kernel/include/libkern/version.h | <gh_stars>100-1000
#ifndef _KERNEL_LIBKERN_VERSION_H
#define _KERNEL_LIBKERN_VERSION_H
#define OSTYPE "opuntiaOS"
#define OSRELEASE "1.0.0-dev"
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_REVISION 0
#define VERSION_VARIANT "0"
#ifdef __i386__
#define MACHINE "x86"
#elif __arm__
#define MACHINE "ar... |
willmexe/opuntiaOS | kernel/include/drivers/bits/driver.h | /*
* Copyright (C) 2020-2022 The opuntiaOS Project Authors.
* + Contributed by <NAME> <<EMAIL>>
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef _KERNEL_DRIVERS_BITS_DRIVER_H
#define _KERNEL_DRIVERS_BITS_DRIVER_H
#include <libkern/types.h>
#def... |
willmexe/opuntiaOS | libs/libc/include/fcntl.h | <reponame>willmexe/opuntiaOS
#ifndef _LIBC_FCNTL_H
#define _LIBC_FCNTL_H
#include <bits/fcntl.h>
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
int open(const char* pathname, int flags);
int creat(const char* path, mode_t mode);
__END_DECLS
#endif // _LIBC_FCNTL_H |
willmexe/opuntiaOS | kernel/include/platform/generic/vmm/consts.h | <reponame>willmexe/opuntiaOS<gh_stars>100-1000
#ifdef __i386__
#include <platform/x86/vmm/consts.h>
#elif __arm__
#include <platform/aarch32/vmm/consts.h>
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.