You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/compilers/includeos.md
-2
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,3 @@ UniK uses [IncludeOS](http://www.includeos.org/) as a platform for compiling C++
5
5
You can also see an [example here](https://github.com/includeos/unik_test_service)
6
6
7
7
Your application code will be called from ```Service::start()``` in `service.cpp`
8
-
9
-
Note the line `unik::register_instance();` in [service.cpp#L41](https://github.com/includeos/unik_test_service/blob/master/service.cpp#L41): this line (and the imported file `#include <unik>`) are required for registering instances of your application to UniK. Without this, UniK will be unable to determine and display IPs of your instances (they will run otherwise normally).
auto& server = net::Inet4::stack().tcp().bind(port);
82
+
server.on_connect([] (auto conn) {
83
+
conn->on_read(1024, [conn] (auto buf, size_t n) {
90
84
auto response {"My first unikernel!\n"s};
91
-
conn->write(response.data(), response.size());
85
+
conn->write(response);
92
86
conn->close();
93
87
});
88
+
});
94
89
}
95
90
```
96
91
@@ -107,9 +102,14 @@ Ensure that each of the following are installed
107
102
# Your disk image
108
103
DISK=
109
104
105
+
# Add networking driver
106
+
DRIVERS=virtionet
107
+
110
108
# Your own include-path
111
109
LOCAL_INCLUDES=
112
110
111
+
PLATFORM=unik
112
+
113
113
# IncludeOS location
114
114
ifndef INCLUDEOS_INSTALL
115
115
INCLUDEOS_INSTALL=$(HOME)/IncludeOS_install
@@ -119,9 +119,7 @@ Ensure that each of the following are installed
119
119
include $(INCLUDEOS_INSTALL)/Makeseed
120
120
```
121
121
122
-
3. (In the very near future, this step will not be necessary, but since you are an early adopter, you will have to add an extra file. [Download the file from GitHub here](https://gist.githubusercontent.com/ingve/ae745418261c8871edf52e8dbdb29099/raw/86783f194f5b31556d242127d18f69b30b6c8c93/unik_register_instance.hpp) and add it to the same folder as `service.cpp`.)
123
-
124
-
4. Great! Now we're ready to compile this code to a unikernel.
122
+
3. Great! Now we're ready to compile this code to a unikernel.
0 commit comments