<commit_before>/* $chaos: dotfile.emacs,v 1.37 2002/10/14 16:03:33 per Exp $ */
/* Abstract: */
/* Author: <NAME> <<EMAIL>> */

/* Copyright 2002 chaos development. */
/* Use freely under the terms listed in the file LICENSE. */

#include <storm/storm.h>
#include <storm/ia32/dispatch.h>
#include <storm/ia32/gdt.h>
#include <storm/ia32/idt.h>
#include <storm/ia32/system_call.h>

/* Set up the system call handler in the IDT. */
void system_call_init (void)
{
    idt_setup_interrupt_gate (SYSTEM_CALL_IDT_ENTRY,
                              KERNEL_CODE_SELECTOR, system_call_lowlevel, 3);
}

/* The high-level system call handler, called from the low-level function. */
void system_call (void)
{
    bool result;
    return_t return_value = capability_has (0, current_process, "kernel",
                                            "debug_print", &result);
    
    if (return_value == STORM_RETURN_SUCCESS &&
        result)
    {
        debug_print ("We have a system call!");
    }
    else
    {
        debug_print ("You don't have the permission to do this.");
    }
}<commit_msg>Just a phony system call for now. It takes the first parameter passed as a string pointer and prints the contents of the string.<commit_after>/* $chaos: system_call.c,v 1.1 2002/10/24 21:31:35 per Exp $ */
/* Abstract: */
/* Author: <NAME> <<EMAIL>> */

/* Copyright 2002 chaos development. */
/* Use freely under the terms listed in the file LICENSE. */

#include <storm/storm.h>
#include <storm/ia32/cpu.h>
#include <storm/ia32/dispatch.h>
#include <storm/ia32/gdt.h>
#include <storm/ia32/idt.h>
#include <storm/ia32/system_call.h>

/* Set up the system call handler in the IDT. */
void system_call_init (void)
{
    idt_setup_interrupt_gate (SYSTEM_CALL_IDT_ENTRY,
                              KERNEL_CODE_SELECTOR, system_call_lowlevel, 3);
}

/* The high-level system call handler, called from the low-level function. */
void system_call (uint32_t *stack)
{
    bool result;
    return_t return_value = capability_has (0, current_process, "kernel",
                                            "debug_print", &result);
    
    if (return_value == STORM_RETURN_SUCCESS &&
        result)
    {
        //        address_t esp = cpu_get_esp ();
        //        debug_memory_dump ((uint32_t *) esp, 17);
        debug_print ("We have a system call! %x %x", cpu_get_esp(), *stack);
        debug_print ("This is the string: %s\n", *stack);
    }
    else
    {
        debug_print ("You don't have the permission to do this.");
    }
}
{'fraction_non_alphanumeric': 0.1238132911392405, 'fraction_numerical': 0.027294303797468354, 'mean_word_length': 2.6025641025641026, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4102996', 'n_tokens_mistral': 851, 'n_tokens_neox': 797, 'n_words': 236}