mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-08-04 01:36:10 -04:00
New program: divzero
Simply here to test behaviour of user mode exception
This commit is contained in:
parent
ec948d5841
commit
09a88a9087
14
programs/divzero/Makefile
Normal file
14
programs/divzero/Makefile
Normal file
@ -0,0 +1,14 @@
|
||||
.PHONY: default clean
|
||||
|
||||
EXEC_NAME=divzero
|
||||
|
||||
default: link
|
||||
|
||||
include ../../cpp.mk
|
||||
|
||||
$(eval $(call program_compile_cpp_folder,src))
|
||||
$(eval $(call program_link_executable,$(EXEC_NAME)))
|
||||
|
||||
clean:
|
||||
@ echo -e "Remove compiled files"
|
||||
@ rm -rf debug
|
16
programs/divzero/src/main.cpp
Normal file
16
programs/divzero/src/main.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
//=======================================================================
|
||||
// Copyright Baptiste Wicht 2013-2016.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//=======================================================================
|
||||
|
||||
#include <system.hpp>
|
||||
|
||||
volatile int a = 0;
|
||||
|
||||
int main(int /*argc*/, char* /*argv*/[]){
|
||||
a = 42 / a;
|
||||
|
||||
exit(a);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user