Adapt code for tlib

This commit is contained in:
Baptiste Wicht 2016-08-17 22:23:28 +02:00
parent 04b1d4df0d
commit 08e9ce2f53
57 changed files with 168 additions and 157 deletions

View File

@ -8,12 +8,13 @@
#ifndef DISKS_H
#define DISKS_H
#include <datetime.hpp>
#include <types.hpp>
#include <array.hpp>
#include <vector.hpp>
#include <string.hpp>
#include <tlib/datetime.hpp>
#include "vfs/vfs.hpp"
#include "vfs/file.hpp"

View File

@ -10,7 +10,7 @@
#include <types.hpp>
#include "ioctl_codes.hpp"
#include <tlib/ioctl_codes.hpp>
int64_t ioctl(size_t device_fd, ioctl_request request, void* data);

View File

@ -8,7 +8,7 @@
#ifndef RTC_H
#define RTC_H
#include <datetime.hpp>
#include <tlib/datetime.hpp>
namespace rtc {

View File

@ -8,10 +8,11 @@
#ifndef VFS_FILE_H
#define VFS_FILE_H
#include <datetime.hpp>
#include <types.hpp>
#include <string.hpp>
#include <tlib/datetime.hpp>
namespace vfs {
struct file {

View File

@ -8,10 +8,11 @@
#ifndef VFS_FILE_SYSTEM_H
#define VFS_FILE_SYSTEM_H
#include <statfs_info.hpp>
#include <vector.hpp>
#include <string.hpp>
#include <tlib/statfs_info.hpp>
#include "file.hpp"
#include "path.hpp"

View File

@ -8,8 +8,8 @@
#ifndef VFS_H
#define VFS_H
#include <stat_info.hpp>
#include <statfs_info.hpp>
#include <tlib/stat_info.hpp>
#include <tlib/statfs_info.hpp>
#include "vfs/path.hpp"

View File

@ -7,6 +7,8 @@
#include <lock_guard.hpp>
#include <tlib/errors.hpp>
#include "ata.hpp"
#include "ata_constants.hpp"
#include "kernel_utils.hpp"
@ -14,7 +16,6 @@
#include "thor.hpp"
#include "interrupts.hpp"
#include "console.hpp"
#include "errors.hpp"
#include "disks.hpp"
#include "mutex.hpp"
#include "block_cache.hpp"

View File

@ -8,7 +8,8 @@
#include <types.hpp>
#include <unique_ptr.hpp>
#include <algorithms.hpp>
#include <errors.hpp>
#include <tlib/errors.hpp>
#include "fs/devfs.hpp"

View File

@ -8,7 +8,8 @@
#include <types.hpp>
#include <unique_ptr.hpp>
#include <algorithms.hpp>
#include <errors.hpp>
#include <tlib/errors.hpp>
#include "fs/fat32.hpp"

View File

@ -8,9 +8,10 @@
#include <types.hpp>
#include <unique_ptr.hpp>
#include <algorithms.hpp>
#include <errors.hpp>
#include <string.hpp>
#include <tlib/errors.hpp>
#include "fs/procfs.hpp"
#include "scheduler.hpp"

View File

@ -8,7 +8,8 @@
#include <types.hpp>
#include <unique_ptr.hpp>
#include <algorithms.hpp>
#include <errors.hpp>
#include <tlib/errors.hpp>
#include "fs/sysfs.hpp"

View File

@ -5,8 +5,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <tlib/errors.hpp>
#include "ioctl.hpp"
#include "errors.hpp"
#include "scheduler.hpp"
#include "logging.hpp"
#include "fs/devfs.hpp"

View File

@ -5,6 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <string.hpp>
#include <tlib/flags.hpp>
#include "logging.hpp"
#include "assert.hpp"
#include "console.hpp"
@ -12,9 +16,6 @@
#include "early_memory.hpp"
#include "vfs/vfs.hpp"
#include <flags.hpp>
#include <string.hpp>
namespace {
bool early_mode = true;

View File

@ -5,8 +5,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <tlib/errors.hpp>
#include "ramdisk.hpp"
#include "errors.hpp"
#include "disks.hpp"
#include "paging.hpp"
#include "logging.hpp"

View File

@ -10,7 +10,9 @@
#include <optional.hpp>
#include <string.hpp>
#include <lock_guard.hpp>
#include <errors.hpp>
#include <tlib/errors.hpp>
#include <tlib/elf.hpp>
#include "scheduler.hpp"
#include "paging.hpp"
@ -18,7 +20,6 @@
#include "gdt.hpp"
#include "terminal.hpp"
#include "disks.hpp"
#include "elf.hpp"
#include "console.hpp"
#include "physical_allocator.hpp"
#include "virtual_allocator.hpp"
@ -28,6 +29,7 @@
#include "logging.hpp"
#include "int_lock.hpp"
#include "timer.hpp"
#include "fs/procfs.hpp"
//Provided by task_switch.s

View File

@ -5,12 +5,13 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <errors.hpp>
#include <string.hpp>
#include <algorithms.hpp>
#include <directory_entry.hpp>
#include <mount_point.hpp>
#include <tlib/directory_entry.hpp>
#include <tlib/mount_point.hpp>
#include <tlib/errors.hpp>
#include <tlib/flags.hpp>
#include "vfs/vfs.hpp"
#include "vfs/file_system.hpp"
@ -21,12 +22,11 @@
#include "fs/procfs.hpp"
#include "scheduler.hpp"
#include "flags.hpp"
#include "console.hpp"
#include "logging.hpp"
#include "assert.hpp"
namespace {
struct mounted_fs {

View File

@ -5,8 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <tlib/print.hpp>
int main(int argc, char* argv[]){
for(size_t i = 0; i < size_t(argc); ++i){

View File

@ -5,9 +5,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <datetime.hpp>
#include <tlib/print.hpp>
#include <tlib/system.hpp>
constexpr const size_t PAGES = 512;

View File

@ -5,10 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
int main(int argc, char* argv[]){
if(argc == 1){

View File

@ -6,8 +6,9 @@
//=======================================================================
#include <string.hpp>
#include <print.hpp>
#include <system.hpp>
#include <tlib/print.hpp>
#include <tlib/system.hpp>
namespace {

View File

@ -5,8 +5,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <system.hpp>
#include <print.hpp>
#include <tlib/print.hpp>
#include <tlib/system.hpp>
int main(int, char*[]){
auto date = local_date();

View File

@ -5,12 +5,12 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <mount_point.hpp>
#include <statfs_info.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/mount_point.hpp>
#include <tlib/statfs_info.hpp>
static constexpr const size_t BUFFER_SIZE = 4096;

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <system.hpp>
#include <tlib/system.hpp>
volatile int a = 0;

View File

@ -5,8 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <tlib/print.hpp>
const char* source = "Hello world";
@ -20,4 +19,4 @@ int main(){
}
return 0;
}
}

View File

@ -5,8 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <tlib/print.hpp>
volatile uint64_t current = 45;
@ -31,4 +30,4 @@ int main(){
print_line("END");
return 0;
}
}

View File

@ -5,8 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <tlib/print.hpp>
volatile uint64_t current = 45;
@ -27,4 +26,4 @@ int main(){
}
return 0;
}
}

View File

@ -5,8 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <tlib/print.hpp>
volatile uint64_t current = 45;
@ -27,4 +26,4 @@ int main(){
}
return 0;
}
}

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <directory_entry.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/directory_entry.hpp>
static constexpr const size_t BUFFER_SIZE = 4096;

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <directory_entry.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/directory_entry.hpp>
static constexpr const size_t BUFFER_SIZE = 4096;

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <directory_entry.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/directory_entry.hpp>
static constexpr const size_t BUFFER_SIZE = 4096;

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <flags.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/flags.hpp>
int main(int argc, char* argv[]){
if(argc == 1){
@ -24,4 +24,4 @@ int main(int argc, char* argv[]){
}
return 0;
}
}

View File

@ -5,14 +5,15 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <io.hpp>
#include <print.hpp>
#include <unique_ptr.hpp>
#include <math.hpp>
#include <array.hpp>
#include <unique_ptr.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/io.hpp>
#include <tlib/print.hpp>
#include "fat32_specs.hpp"

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <mount_point.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/mount_point.hpp>
static constexpr const size_t BUFFER_SIZE = 4096;

View File

@ -5,10 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <system.hpp>
#include <graphics.hpp>
#include <print.hpp>
#include <malloc.hpp>
#include <tlib/system.hpp>
#include <tlib/graphics.hpp>
#include <tlib/print.hpp>
#include <tlib/malloc.hpp>
namespace {

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <directory_entry.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/directory_entry.hpp>
namespace {

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <elf.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/elf.hpp>
namespace {
@ -120,4 +120,4 @@ int main(int argc, char* argv[]){
}
return 0;
}
}

View File

@ -5,9 +5,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <system.hpp>
#include <tlib/system.hpp>
int main(){
reboot();
return 0;
}
}

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <flags.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/flags.hpp>
int main(int argc, char* argv[]){
if(argc == 1){
@ -32,4 +32,4 @@ int main(int argc, char* argv[]){
}
return 0;
}
}

View File

@ -5,10 +5,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include <tlib/system.hpp>
int main(){
shutdown();
return 0;
}
}

View File

@ -5,10 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
int main(int argc, char* argv[]){
if(argc == 1){
@ -94,4 +94,4 @@ int main(int argc, char* argv[]){
}
return 0;
}
}

View File

@ -5,11 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <flags.hpp>
#include <tlib/file.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/flags.hpp>
int main(int argc, char* argv[]){
if(argc == 1){
@ -26,4 +25,4 @@ int main(int argc, char* argv[]){
}
return 0;
}
}

View File

@ -5,12 +5,13 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <file.hpp>
#include <system.hpp>
#include <string.hpp>
#include <algorithms.hpp>
#include <errors.hpp>
#include <tlib/print.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
namespace {

View File

@ -5,10 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
int main(int, char*[]){
auto fd = open("/sys/uptime");

View File

@ -5,10 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
int main(int argc, char* argv[]){
if(argc == 1){

View File

@ -5,11 +5,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include <system.hpp>
#include <errors.hpp>
#include <print.hpp>
#include <flags.hpp>
#include <tlib/file.hpp>
#include <tlib/system.hpp>
#include <tlib/errors.hpp>
#include <tlib/print.hpp>
#include <tlib/flags.hpp>
int main(int argc, char* argv[]){
if(argc == 1){
@ -42,4 +42,4 @@ int main(int argc, char* argv[]){
}
return 0;
}
}

View File

@ -11,8 +11,9 @@
#include <types.hpp>
#include <expected.hpp>
#include <string.hpp>
#include <stat_info.hpp>
#include <statfs_info.hpp>
#include "tlib/stat_info.hpp"
#include "tlib/statfs_info.hpp"
std::expected<size_t> open(const char* file, size_t flags = 0);
int64_t mkdir(const char* file);

View File

@ -11,7 +11,7 @@
#include <types.hpp>
#include <expected.hpp>
#include "ioctl_codes.hpp"
#include "tlib/ioctl_codes.hpp"
int64_t ioctl(size_t device, ioctl_request request, void* data);

View File

@ -9,7 +9,8 @@
#define USER_STAT_INFO_HPP
#include <types.hpp>
#include <datetime.hpp>
#include "tlib/datetime.hpp"
constexpr const size_t STAT_FLAG_DIRECTORY = 0x1;
constexpr const size_t STAT_FLAG_HIDDEN = 0x2;

View File

@ -12,7 +12,8 @@
#include <expected.hpp>
#include <vector.hpp>
#include <string.hpp>
#include <datetime.hpp>
#include "tlib/datetime.hpp"
void exit(size_t return_code) __attribute__((noreturn));

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <file.hpp>
#include "tlib/file.hpp"
std::expected<size_t> open(const char* file, size_t flags){
int64_t fd;

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include "graphics.hpp"
#include "tlib/graphics.hpp"
namespace {

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <io.hpp>
#include "tlib/io.hpp"
int64_t ioctl(size_t device, ioctl_request request, void* data){
int64_t code;

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include "malloc.hpp"
#include "tlib/malloc.hpp"
#define likely(x) __builtin_expect (!!(x), 1)
#define unlikely(x) __builtin_expect (!!(x), 0)

View File

@ -7,7 +7,7 @@
#include <stdarg.h>
#include "print.hpp"
#include "tlib/print.hpp"
void print(char c){
asm volatile("mov rax, 0; mov rbx, %[c]; int 50"

View File

@ -5,8 +5,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <print.hpp>
#include <system.hpp>
#include "tlib/print.hpp"
#include "tlib/system.hpp"
extern "C" {

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <system.hpp>
#include "tlib/system.hpp"
int main(int argc, char* argv[]);

View File

@ -5,7 +5,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <system.hpp>
#include "tlib/system.hpp"
namespace {