Skip to content

Instantly share code, notes, and snippets.

View nulldatamap's full-sized avatar

Nulldata nulldatamap

View GitHub Profile
package io.nulldata.protocols;
import io.nulldata.utils.Maybe;
import java.io.IOException;
import java.nio.ByteBuffer;
public class Test {
public static void register_packets() {

In the linking phase of the kernel build ld returns with the following error:

rskernel.o: In function `kmain':
kernel.rs:(.text.kmain+0x7d): undefined reference to `ZN7failure5fail_20h663017d6c5d27101NWjE'

In the kernel.rs file the following code is provoking a call to core::failure::fail_:

provoke_fail_( 0/0 ); // 0/0 will call fail_ due to zero division

The core library is referenced via extern crate core; in kernel.rs.

bits 16
extern kmain
extern report_morestack
global start
global _abort
global idt_entries
section .text
let buf = &[0u,..16];
let bufw = StringWriter::new(buf);
match (&10,) {
(__arg0,) => {
#[inline]
#[allow(dead_code)]
static __STATIC_FMTSTR:
[::std::fmt::rt::Piece<'static>, ..1u]
=
[::std::fmt::rt::Argument(::std::fmt::rt::Argument{position:

My problem:

( 0x7cb6 as *const u8 ) == ( (&idtr) as *const u8 ) // false

Well, that's consequence. Let me explain.

First some information about the code. It's a part of my kernel ( the code that sets up the interrupt table to be specific. ). The target for the code is --target i686-unknown-linux-gnu and it's using --emit obj in order to link it with the bootloader at a later point.

import Data.Bits
import Data.Char
import Data.Word
_intToHex :: Int -> Int -> Bool -> String
-- i: integer, l: length of the number string, s: show sign?
_intToHex i l s = sign ++ body
where
n = if i < 0
then if s
// Actor::update( &mut self, &Vec<Box<Actor>> )
pub fn update( &mut self ) {
for i in range( 0u, self.actors.len() ) {
let actor = self.actors.get_mut( i );
actor.update( &self.actors );
}
}
(ns world.gen)
(defn rrange [mn mx]
(+ (* (rand)
(- mx mn))
mn))
(defn printmatrix [matrix]
(print(reduce str(for [x matrix] (str (reduce str(for [y x] (if (= y nil)0 1))) "\n")))) matrix)
#![feature(asm)]
extern crate time;
use std::rand::random;
use std::char::from_u32;
use time::precise_time_ns;
type Chunk = [char, ..5];
impl MarketData {
pub fn collect( &mut self, market : &mut Market ) {
self.day_count += 1;
self.asset_history.push( market.assets );
self.price_history.push( market.price );
self.holders_history.push( market.holders );
}