int smk_create_console( int pages, int mode, int pid, int port, int active_pid ) { struct console_data *rConsole; void *data; char *buf; int i; if ( pages < 3 ) return -1; data = smk_mem_alloc( pages ); buf = (char*)data; for ( i = 0; i < (pages * 4096); i += 2 ) { buf[ i ] = ' '; buf[ i + 1 ] = 7; } rConsole = (struct console_data*)( (uint32)data + (pages-1) * 4096 ); rConsole->magic = CONSOLE_MAGIC; rConsole->spinlock = 0; rConsole->mode = mode; rConsole->x = 0; rConsole->y = 0; rConsole->pid = pid; rConsole->port = port; rConsole->attr = 14; i = smk_stage_console( data, pages ); if ( i >= 0 ) smk_set_active_pid( i, active_pid ); return i; }
void* liballoc_alloc(int pages) { return smk_mem_alloc( pages ); }