示例#1
0
// Starts the kernel's idle process. This process has kernel permissions.
int idle_main(int argc, char ** params) {
	
	int i = 0;
	char a[] = { ' ', 0x07 };
	
	for(; i < 2000; ++i)	{
		memcpy((char*)0xb8000 + i * 2, a, 2);
	}
	
	// The funny message, windows says starting windows... why shouldn't we? D:
	char start_msg[][2] =	{ 
		{ 'S', 0x07 },
		{ 't', 0x08 },
		{ 'a', 0x09 },
		{ 'r', 0x0a },
		{ 't', 0x0b },
		{ 'i', 0x0c },
		{ 'n', 0x0d },
		{ 'g', 0x0e },
		{ ' ', 0x0f },
		{ 'M', 0x02 },
		{ 'o', 0x03 },
		{ 'n', 0x04 },
		{ 'i', 0x05 },
		{ 'x', 0x06 },
		{ ' ', 0x0f },
		{ '\001', 0x5f },
	};
	
	i = 0;
	for(; i < 16; ++i)	{
		memcpy((char*)0xb8000 + i * 2, start_msg[i], 2);
		_setCursor(i);
	}
	
	Cli();
	make_atomic();

	mount();					// Mount or start the FS

	tty_init(0);				// Load up the TTY's
	tty_init(1);
	tty_init(2);
	tty_init(3);
	tty_init(4);
	tty_init(5);		
	
	setready(); 				// Set the kernel as ready and the FS as loaded
	users_init();				// Init the users
	
	fs_finish();

	release_atomic();	
	Sti();


	while(1) {
		_Halt(); // Now set to idle.
	}
}
 KVRecordStore::KVRecordCursor::KVRecordCursor(const KVRecordStore &rs, KVDictionary *db, OperationContext *txn, const bool isForward)
     : _rs(rs),
       _db(db),
       _savedLoc(),
       _savedVal(),
       _lowestInvisible(),
       _idTracker(NULL),
       _txn(txn),
       _cursor(),
       _isForward(isForward) {
     if (isForward) {
         _setCursor(RecordId::min());
     } else {
         _setCursor(RecordId::max());
     }
 }
示例#3
0
// Just counts ticks and updates the cursor.
void int_08() {
	
	
	showHour();
	printKeyboard();
	printSound();
	ticks++;
	cursor_ticks++;
	if (cursor_ticks % 5 == 0)
		if (hardCursorEnabled) {
			cursorEnabled = !cursorEnabled;
			if (cursorEnabled)
				_setCursor(videoPos / 2);
			else
				_setCursor(-1);
		}
		
}
    bool KVRecordStore::KVRecordCursor::restoreState() {
        invariant(!_cursor);
        if (!_savedLoc.isNull()) {
            RecordId saved = _savedLoc;
            _setCursor(_savedLoc);
            if (curr() != saved && _rs.isCapped()) {
                // Doc was deleted either by cappedDeleteAsNeeded() or cappedTruncateAfter()
                _cursor.reset();
                return false;
            }
        } else {
            // We had saved state when the cursor was at EOF, so the savedLoc
            // was null - therefore we must restoreState to EOF as well. 
            //
            // Assert that this is indeed the case.
            invariant(isEOF());
        }

        // `true' means the collection still exists, which is always the case
        // because this cursor would have been deleted by higher layers if
        // the collection were to indeed be dropped.
        return true;
    }
示例#5
0
文件: video.c 项目: kshmir/so-2011-3
// TODO: Move me.
void setVideoPos(int a) {
	videoPos = a;
	if (cursorEnabled) { 
		_setCursor(a / 2);
	}
}
 boost::optional<Record> KVRecordStore::KVRecordCursor::seekExact(const RecordId& id) {
     _cursor.reset();
     _setCursor(id);
     return next();
 }