Compare commits
2 Commits
c0cf952113
...
5cb4b8b1fe
Author | SHA1 | Date | |
---|---|---|---|
5cb4b8b1fe | |||
d9713723c9 |
@ -21,6 +21,10 @@ The script provided by the project to run the system, `tools/run.sh`, assumes th
|
|||||||
|
|
||||||
That being said, there's no requirement to use QEMU. If you want to use a different virtualization program, such as Oracle VirtualBox or VMWare, just use `tools/build-iso.sh` instead of `run.sh` and use the built `Luna.iso` in those programs.
|
That being said, there's no requirement to use QEMU. If you want to use a different virtualization program, such as Oracle VirtualBox or VMWare, just use `tools/build-iso.sh` instead of `run.sh` and use the built `Luna.iso` in those programs.
|
||||||
|
|
||||||
|
## Formatting/linting
|
||||||
|
|
||||||
|
Please make sure you have `clang-format` installed. Additionally, if your editor does not support format-on-save or you do not have it configured, please run `tools/run-clang-format.sh` before committing, to make sure all code follows the same style conventions.
|
||||||
|
|
||||||
## Source dependencies
|
## Source dependencies
|
||||||
TLDR: Luna does not depend on any third-party library.
|
TLDR: Luna does not depend on any third-party library.
|
||||||
|
|
||||||
|
@ -77,8 +77,7 @@ static void log_text_console(LogLevel level, const char* format, va_list origin)
|
|||||||
TextConsole::set_foreground(WHITE);
|
TextConsole::set_foreground(WHITE);
|
||||||
|
|
||||||
// NOTE: Same as above.
|
// NOTE: Same as above.
|
||||||
auto rc = cstyle_format(
|
auto rc = cstyle_format(format, [](char c, void*) -> Result<void> { return TextConsole::putchar(c); }, nullptr, ap);
|
||||||
format, [](char c, void*) -> Result<void> { return TextConsole::putchar(c); }, nullptr, ap);
|
|
||||||
|
|
||||||
if (rc.has_error()) { TextConsole::wprint(L"Invalid UTF-8 in log message"); }
|
if (rc.has_error()) { TextConsole::wprint(L"Invalid UTF-8 in log message"); }
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
static inline constexpr u32 make_pci_address(const PCI::Device::Address& address, u32 field)
|
static inline constexpr u32 make_pci_address(const PCI::Device::Address& address, u32 field)
|
||||||
{
|
{
|
||||||
return 0x80000000 | (address.bus << 16) | (address.slot << 11) | (address.function << 8) | ((field)&0xFC);
|
return 0x80000000 | (address.bus << 16) | (address.slot << 11) | (address.function << 8) | ((field) & 0xFC);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace PCI
|
namespace PCI
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#include "memory/SharedMemory.h"
|
#include "memory/SharedMemory.h"
|
||||||
#include "video/Framebuffer.h"
|
#include "video/Framebuffer.h"
|
||||||
#include <bits/ioctl-defs.h>
|
#include <bits/ioctl-defs.h>
|
||||||
#include <luna/CString.h>
|
|
||||||
#include <luna/Alignment.h>
|
#include <luna/Alignment.h>
|
||||||
|
#include <luna/CString.h>
|
||||||
|
|
||||||
Result<void> FramebufferDevice::create()
|
Result<void> FramebufferDevice::create()
|
||||||
{
|
{
|
||||||
|
@ -207,8 +207,8 @@ namespace TextConsole
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
const usize rc = TRY(cstyle_format(
|
const usize rc =
|
||||||
format, [](char c, void*) -> Result<void> { return putchar(c); }, nullptr, ap));
|
TRY(cstyle_format(format, [](char c, void*) -> Result<void> { return putchar(c); }, nullptr, ap));
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
if (value < 0) \
|
if (value < 0) \
|
||||||
{ \
|
{ \
|
||||||
errno = (int)(-value); \
|
errno = (int)(-value); \
|
||||||
return (type)-1; \
|
return (type) - 1; \
|
||||||
} \
|
} \
|
||||||
return (type)value; \
|
return (type)value; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <bits/fixed-size-types.h>
|
#include <bits/fixed-size-types.h>
|
||||||
|
|
||||||
#define luna_dev_major(dev) (__u32_t)((dev) >> 32)
|
#define luna_dev_major(dev) (__u32_t)((dev) >> 32)
|
||||||
#define luna_dev_minor(dev) (__u32_t)((dev)&0xffffffff)
|
#define luna_dev_minor(dev) (__u32_t)((dev) & 0xffffffff)
|
||||||
#define luna_dev_makedev(maj, min) (((__u64_t)(maj) << 32) | (__u64_t)(min))
|
#define luna_dev_makedev(maj, min) (((__u64_t)(maj) << 32) | (__u64_t)(min))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#define S_IFCHR 050000
|
#define S_IFCHR 050000
|
||||||
#define S_IFSOCK 060000
|
#define S_IFSOCK 060000
|
||||||
|
|
||||||
#define __CHECK_TYPE(mode, type) (((mode)&S_IFMT) == type)
|
#define __CHECK_TYPE(mode, type) (((mode) & S_IFMT) == type)
|
||||||
|
|
||||||
#define S_ISREG(mode) __CHECK_TYPE(mode, S_IFREG)
|
#define S_ISREG(mode) __CHECK_TYPE(mode, S_IFREG)
|
||||||
#define S_ISDIR(mode) __CHECK_TYPE(mode, S_IFDIR)
|
#define S_ISDIR(mode) __CHECK_TYPE(mode, S_IFDIR)
|
||||||
|
@ -34,12 +34,6 @@ struct timeval
|
|||||||
} while (0);
|
} while (0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TIMEVAL_TO_TIMESPEC(x) \
|
#define TIMEVAL_TO_TIMESPEC(x) { .tv_sec = (x).tv_sec, .tv_nsec = (x).tv_usec * 1000 }
|
||||||
{ \
|
#define TIMESPEC_TO_TIMEVAL(x) { .tv_sec = (x).tv_sec, .tv_usec = (x).tv_nsec / 1000 }
|
||||||
.tv_sec = (x).tv_sec, .tv_nsec = (x).tv_usec * 1000 \
|
|
||||||
}
|
|
||||||
#define TIMESPEC_TO_TIMEVAL(x) \
|
|
||||||
{ \
|
|
||||||
.tv_sec = (x).tv_sec, .tv_usec = (x).tv_nsec / 1000 \
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
#include <bits/waitpid.h>
|
#include <bits/waitpid.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#define WIFEXITED(ret) (((ret)&_SIGBIT) == 0)
|
#define WIFEXITED(ret) (((ret) & _SIGBIT) == 0)
|
||||||
#define WEXITSTATUS(ret) ((ret)&0xff)
|
#define WEXITSTATUS(ret) ((ret) & 0xff)
|
||||||
#define WIFSIGNALED(ret) (((ret)&_SIGBIT) == _SIGBIT)
|
#define WIFSIGNALED(ret) (((ret) & _SIGBIT) == _SIGBIT)
|
||||||
#define WTERMSIG(ret) ((ret)&0xff)
|
#define WTERMSIG(ret) ((ret) & 0xff)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
template <typename T> inline T&& move(T& lvalue)
|
template <typename T> inline T&& move(T& lvalue)
|
||||||
{
|
{
|
||||||
return (T &&) lvalue;
|
return (T&&)lvalue;
|
||||||
}
|
}
|
||||||
|
@ -60,16 +60,14 @@ extern "C"
|
|||||||
usize strlen(const char* str)
|
usize strlen(const char* str)
|
||||||
{
|
{
|
||||||
const char* i = str;
|
const char* i = str;
|
||||||
for (; *i; ++i)
|
for (; *i; ++i);
|
||||||
;
|
|
||||||
return (usize)(i - str);
|
return (usize)(i - str);
|
||||||
}
|
}
|
||||||
|
|
||||||
usize strnlen(const char* str, usize max)
|
usize strnlen(const char* str, usize max)
|
||||||
{
|
{
|
||||||
const char* i = str;
|
const char* i = str;
|
||||||
for (; *i && max; ++i, --max)
|
for (; *i && max; ++i, --max);
|
||||||
;
|
|
||||||
return (usize)(i - str);
|
return (usize)(i - str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +106,7 @@ extern "C"
|
|||||||
usize wcslen(const wchar_t* str)
|
usize wcslen(const wchar_t* str)
|
||||||
{
|
{
|
||||||
const wchar_t* i = str;
|
const wchar_t* i = str;
|
||||||
for (; *i; ++i)
|
for (; *i; ++i);
|
||||||
;
|
|
||||||
return (usize)(i - str);
|
return (usize)(i - str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ source $(dirname $0)/env.sh
|
|||||||
|
|
||||||
cd $LUNA_ROOT
|
cd $LUNA_ROOT
|
||||||
|
|
||||||
FOLDERS=(kernel libc libos libui libluna apps shell tests)
|
FOLDERS=(kernel libc libos gui libluna utils shell tests system)
|
||||||
|
|
||||||
SOURCES=($(find ${FOLDERS[@]} -type f -name "*.cpp"))
|
SOURCES=($(find ${FOLDERS[@]} -type f -name "*.cpp"))
|
||||||
SOURCES+=($(find ${FOLDERS[@]} -type f -name "*.h"))
|
SOURCES+=($(find ${FOLDERS[@]} -type f -name "*.h"))
|
||||||
|
Loading…
Reference in New Issue
Block a user