Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

C++, 51 40 bytes

-11 bytes thanks to IngveIngve!

#include<os>
int main(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
int main(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-9-g151a2b9
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$

C++, 51 40 bytes

-11 bytes thanks to Ingve!

#include<os>
int main(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
int main(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-9-g151a2b9
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$

C++, 51 40 bytes

-11 bytes thanks to Ingve!

#include<os>
int main(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
int main(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-9-g151a2b9
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$
added 100 characters in body
Source Link
simon
  • 351
  • 1
  • 9

C++, 5151 40 bytes

-11 bytes thanks to Ingve!

#include<os>
voidint Service::startmain(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
voidint Service::startmain(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-dirty9-g151a2b9
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$

C++, 51 bytes

#include<os>
void Service::start(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
void Service::start(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-dirty
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$

C++, 51 40 bytes

-11 bytes thanks to Ingve!

#include<os>
int main(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
int main(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-9-g151a2b9
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$
deleted 99 characters in body
Source Link
simon
  • 351
  • 1
  • 9

C++, 6951 bytes

#include<os>
void Service::start(const std::string&){OS::shutdown();}

Only works in IncludeOS (v0.9.3)

A later release, v0.10.0-rc.1, has a void Service::start(), so with that version we're down to 51 bytes. I wasn't able to install/build that version though, so I'm submitting the 69 byte solution for v0.9.3.)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
void Service::start(const std::string&){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ qemu-system-x86_64 -drive file=Demo_Service.img,format=raw,if=ide -nographic -smp 4 -m 128 -kboot en-usbuild/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.910.3 0-rc.1-dirty
 +--> Running [ IncludeOS Demominimal Serviceexample ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$

C++, 69 bytes

#include<os>
void Service::start(const std::string&){OS::shutdown();}

Only works in IncludeOS (v0.9.3)

A later release, v0.10.0-rc.1, has a void Service::start(), so with that version we're down to 51 bytes. I wasn't able to install/build that version though, so I'm submitting the 69 byte solution for v0.9.3.

Test:

$ cat service.cpp
#include<os>
void Service::start(const std::string&){OS::shutdown();}

$ make
[...]

$ qemu-system-x86_64 -drive file=Demo_Service.img,format=raw,if=ide -nographic -smp 4 -m 128 -k en-us
[...]
================================================================================
IncludeOS v0.9.3  +--> Running [ IncludeOS Demo Service ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$

C++, 51 bytes

#include<os>
void Service::start(){OS::shutdown();}

Only works in IncludeOS (v0.10.0-rc.1)

Test:

$ pwd
/home/simon/IncludeOS/examples/demo_service

$ cat service.cpp
#include<os>
void Service::start(){OS::shutdown();}

$ mkdir build && cd build && cmake .. && make && cd ..
[...]

$ boot build/IncludeOS_example
[...]
================================================================================
================================================================================
 IncludeOS v0.10.0-rc.1-dirty
 +--> Running [ IncludeOS minimal example ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$
added 213 characters in body
Source Link
simon
  • 351
  • 1
  • 9
Loading
added 518 characters in body
Source Link
simon
  • 351
  • 1
  • 9
Loading
Source Link
simon
  • 351
  • 1
  • 9
Loading