Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ IncludeOS can currently not be built on macOS or Windows.
A minimal IncludeOS "hello world" looks like a regular C++ program:

```c++
#include <iostream>
#include <os>

int main(){
std::cout << "Hello world\n";
std::println("Hello world");
}
```

Expand Down
10 changes: 0 additions & 10 deletions src/kernel/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ void os::register_plugin(Plugin delg, const char* name){
plugins.emplace_back(delg, name);
}

extern void __arch_reboot();
void os::reboot() noexcept
{
__arch_reboot();
}
void os::shutdown() noexcept
{
kernel::state().running = false;
}

void kernel::post_start()
{
// Enable timestamps (if present)
Expand Down
11 changes: 11 additions & 0 deletions src/kernel/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <os.hpp>
#include <kernel.hpp>
#include <arch.hpp>

bool os::is_booted() noexcept {
return kernel::is_booted();
Expand All @@ -24,6 +25,16 @@ const char* os::arch() noexcept {
return Arch::name;
}

void os::reboot() noexcept
{
__arch_reboot();
}

void os::shutdown() noexcept
{
kernel::state().running = false;
}

os::Panic_action os::panic_action() noexcept {
return kernel::panic_action();
}
Expand Down
2 changes: 2 additions & 0 deletions src/kernel/service_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ void Service::start(const std::string& cmd)
int exit_status = main(argc, argv);
INFO("main","returned with status %d", exit_status);
#endif

os::shutdown();
}

__attribute__((weak))
Expand Down
3 changes: 1 addition & 2 deletions test/integration/kernel/kprint/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import division
from __future__ import print_function
from builtins import str
from past.utils import old_div
import sys
import os

Expand All @@ -27,7 +26,7 @@ def set_format_string_size(line):
def check_truncation(line):
assert(format_string_size)

print("Received truncated string: ", line, "of size", len(line), "(format size * ", old_div(len(line),format_string_size),")")
print("Received truncated string: ", line, "of size", len(line), "(format size * ", len(line)//format_string_size,")")
assert(len(line) <= format_string_size * 2)
# truncated outputs are unacceptable :)
assert(line.strip().split(" ")[-1] == "END")
Expand Down
13 changes: 5 additions & 8 deletions test/integration/net/http/test.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/usr/bin/env python3

from future import standard_library
standard_library.install_aliases()
from builtins import str
import sys
import os
import _thread
import http.server
import sys
import urllib.error
import urllib.parse
import urllib.request

from vmrunner import vmrunner

HOST = ''
PORT = 9011

import http.server

DO_SERVE = True
class RequestHandler(http.server.BaseHTTPRequestHandler):
def do_GET(s):
Expand All @@ -36,7 +34,6 @@ def Client_test():
_thread.start_new_thread(Client_test, ())


import urllib.request, urllib.error, urllib.parse
def Server_test(triggerline):
res = urllib.request.urlopen("http://10.0.0.46:8080").read()
assert(res.decode('utf-8') == "Hello")
Expand Down
1 change: 0 additions & 1 deletion test/misc/lest_util/os_mock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void kprint(const char* str)
//void os::default_stdout(const char*, size_t) {}
void os::event_loop() {}
void os::halt() noexcept {}
void os::reboot() noexcept {}

void __x86_init_paging(void*){};
namespace x86 {
Expand Down