/branches/dynload/boot/arch/sparc64/loader/main.c |
---|
271,8 → 271,6 |
printf("done.\n"); |
#endif |
setup_palette(); |
printf("\nBooting the kernel...\n"); |
jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, |
bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, |
/branches/dynload/boot/arch/ia64/loader/gefi/HelenOS/hello.c |
---|
12,7 → 12,7 |
//Link image as a data array into hello - usefull with network boot |
//#define IMAGE_LINKED |
#define IMAGE_LINKED |
bootinfo_t *bootinfo=(bootinfo_t *)BOOTINFO_ADDRESS; |
86,7 → 86,6 |
StrCpy(FileName,DevicePathToStr(LoadedImage->FilePath)); |
for(i=StrLen(FileName);i>=0 && FileName[i]!='\\';i--); |
FileName[i] = 0; |
FileName[0] = 0; |
Print(L"%s\n",LoadedImage->LoadOptions); |
106,9 → 105,9 |
StrCat(FileName,L"\\image.bin"); |
defaultLoad=1; |
} |
/* else{ |
else{ |
CHAR16 buf[1024]; |
//buf[0]='\\'; |
buf[0]='\\'; |
i--; |
int j; |
for(j=0;LoadOptions[i+j]!=L' '&&LoadOptions[i+j]!=0;j++) |
116,17 → 115,6 |
buf[j+1]=0; |
StrCat(FileName,buf); |
defaultLoad=0; |
}*/ |
else{ |
CHAR16 buf[1024]; |
//buf[0]='\\'; |
i--; |
int j; |
for(j=0;LoadOptions[i+j]!=L' '&&LoadOptions[i+j]!=0;j++) |
buf[j]=LoadOptions[i+j]; |
buf[j+1]=0; |
StrCat(FileName,buf); |
defaultLoad=0; |
} |
imageLoad=1; |
/branches/dynload/boot/arch/ia64/loader/gefi/HelenOS/Makefile |
---|
48,7 → 48,7 |
#When selected first lines or second lines, select if image is linked into hello or not - usefull for network boot |
#hello.so: hello.o image.o division.o |
hello.so: hello.o image.bin division.o |
hello.so: hello.o image.bin |
# $(LD) $(LDFLAGS) -Map hello.map hello.o division.o image.o -o hello.so $(LOADLIBES) #link image inside hello |
$(LD) $(LDFLAGS) -Map hello.map hello.o division.o -o hello.so $(LOADLIBES) #dont link image inside hello |
/branches/dynload/boot/arch/ia64/loader/gefi/Makefile |
---|
23,7 → 23,7 |
include Make.defaults |
SUBDIRS = lib gnuefi inc |
SUBDIRS = lib gnuefi inc apps |
all: check_gcc $(SUBDIRS) |
/branches/dynload/boot/arch/ia64/loader/Makefile |
---|
87,37 → 87,21 |
asm.S \ |
boot.S |
COMPONENTS = \ |
$(KERNELDIR)/kernel.bin |
NOCOMPONENTS = \ |
$(KERNELDIR)/kernel.bin |
COMPONENTS = \ |
$(KERNELDIR)/kernel.bin \ |
$(USPACEDIR)/srv/ns/ns \ |
$(USPACEDIR)/srv/loader/loader \ |
$(USPACEDIR)/app/init/init \ |
$(USPACEDIR)/srv/devmap/devmap \ |
$(USPACEDIR)/srv/rd/rd \ |
$(USPACEDIR)/srv/fb/fb \ |
$(USPACEDIR)/srv/kbd/kbd \ |
$(USPACEDIR)/srv/console/console \ |
$(USPACEDIR)/srv/vfs/vfs \ |
$(USPACEDIR)/srv/fb/fb \ |
$(USPACEDIR)/srv/kbd/kbd |
ifeq ($(RDFMT),tmpfs) |
COMPONENTS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs |
endif |
ifeq ($(RDFMT),fat) |
COMPONENTS += $(USPACEDIR)/srv/fs/fat/fat |
endif |
COMPONENTS += \ |
$(USPACEDIR)/srv/console/console |
RD_SRVS = \ |
$(USPACEDIR)/srv/fs/tmpfs/tmpfs \ |
$(USPACEDIR)/srv/fs/fat/fat |
RD_APPS = \ |
$(USPACEDIR)/app/tetris/tetris \ |
$(USPACEDIR)/app/tester/tester \ |
$(USPACEDIR)/srv/devmap/devmap \ |
$(USPACEDIR)/app/cli/cli \ |
$(USPACEDIR)/app/trace/trace \ |
$(USPACEDIR)/app/klog/klog \ |
$(USPACEDIR)/app/bdsh/bdsh |
$(USPACEDIR)/app/klog/klog |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |
134,39 → 118,19 |
# cp gefi/HelenOS/hello.efi /boot/efi/ |
cp gefi/HelenOS/image.bin ../../../../ |
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) |
$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) -o $@ |
image.boot: depend _components.h _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) |
$(LD) -Map image.map -no-check-sections -N -T _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) -o $@ |
depend: |
-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null |
clean: |
-for file in $(RD_SRVS) ; do \ |
rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \ |
done |
-for file in $(RD_APPS) ; do \ |
rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \ |
done |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o $(OBJECTS) image.boot image.map image.disasm initrd.img image.boot Makefile.depend ../../../../image.bin ../../../../hello.efi |
-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot image.map image.disasm Makefile.depend ../../../../image.bin ../../../../hello.efi |
make -C gefi clean |
make -C gefi/HelenOS clean |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS) initrd.o: $(COMPONENTS) $(RD_SRVS) $(RD_APPS) _link.ld.in |
for file in $(RD_SRVS) ; do \ |
cp $$file $(USPACEDIR)/dist/srv/ ; \ |
done |
for file in $(RD_APPS) ; do \ |
cp $$file $(USPACEDIR)/dist/app/ ; \ |
done |
ifeq ($(RDFMT),tmpfs) |
../../../../tools/mktmpfs.py $(USPACEDIR)/dist/ initrd.fs |
endif |
ifeq ($(RDFMT),fat) |
../../../../tools/mkfat.py $(USPACEDIR)/dist/ initrd.fs |
endif |
../../../../tools/mkhord.py 16384 initrd.fs initrd.img |
rm initrd.fs |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 16384 "unsigned long" $(COMPONENTS) ./initrd.img |
_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in |
../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 16384 "unsigned long" $(COMPONENTS) |
%.o: %.S |
$(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
/branches/dynload/boot/arch/ia64/loader/_link.ld.in |
---|
12,14 → 12,11 |
*(.data); /* initialized data */ |
_got = . ; |
*(.got .got.*); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); |
} |
.sboot : { |
*(.sdata); |
*(.sdata2); |
*(.sbss); |
*(.bss); /* uninitialized static variables */ |
*(COMMON); |
} |
/DISCARD/ : { |
/branches/dynload/boot/genarch/ofw.c |
---|
298,6 → 298,7 |
(sizeof(uintptr_t) / sizeof(uint32_t)); |
unsigned int sc = ofw_get_size_cells(ofw_memory) / |
(sizeof(uintptr_t) / sizeof(uint32_t)); |
printf("address cells: %d, size cells: %d. ", ac, sc); |
uintptr_t buf[((ac + sc) * MEMMAP_MAX_RECORDS)]; |
int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(buf)); |
372,49 → 373,7 |
return true; |
} |
/** |
* Sets up the palette for the 8-bit color depth configuration so that the |
* 3:2:3 color scheme can be used. Checks that setting the palette makes sense |
* (appropriate nodes exist in the OBP tree and the color depth is not greater |
* than 8). |
* |
* @return true if the palette has been set, false otherwise |
*/ |
int setup_palette(void) |
{ |
char device_name[BUF_SIZE]; |
/* resolve alias */ |
if (ofw_get_property(ofw_aliases, "screen", device_name, |
sizeof(device_name)) <= 0) |
return false; |
/* for depth greater than 8 it makes no sense to set up the palette */ |
uint32_t depth; |
phandle device = ofw_find_device(device_name); |
if (device == -1) |
return false; |
if (ofw_get_property(device, "depth", &depth, sizeof(uint32_t)) <= 0) |
return false; |
if (depth != 8) |
return false; |
/* required in order to be able to make a method call */ |
ihandle screen = ofw_open(device_name); |
if (screen == -1) |
return false; |
/* setup the palette so that the (inverted) 3:2:3 scheme is usable */ |
unsigned int i; |
for (i = 0; i < 256; i++) |
if (ofw_call("call-method", 6, 1, NULL, "color!", screen, |
255 - i, |
i << 5, |
(i >> 3) << 6, |
(i >> 5) << 5) != 0); |
return true; |
} |
void ofw_quiesce(void) |
{ |
ofw_call("quiesce", 0, 0, NULL); |
/branches/dynload/boot/genarch/ofw.h |
---|
123,7 → 123,6 |
extern int ofw_memmap(memmap_t *map); |
extern int ofw_screen(screen_t *screen); |
extern int ofw_keyboard(keyboard_t *keyboard); |
extern int setup_palette(void); |
extern void ofw_quiesce(void); |
#endif |
/branches/dynload/uspace/lib/libc/generic/mem.c |
---|
File deleted |
Property changes: |
Deleted: svn:mergeinfo |
/branches/dynload/uspace/lib/libc/generic/loader.c |
---|
50,7 → 50,7 |
* @return Pointer to the loader connection structure (should be |
* de-allocated using free() after use). |
*/ |
loader_t *loader_spawn(const char *name) |
loader_t *loader_spawn(char *name) |
{ |
int phone_id, rc; |
loader_t *ldr; |
/branches/dynload/uspace/lib/libc/generic/string.c |
---|
1,6 → 1,7 |
/* |
* Copyright (c) 2005 Martin Decky |
* Copyright (c) 2008 Jiri Svoboda |
* Copyright (C) 1998 by Wes Peters <wes@softweyr.com> |
* Copyright (c) 1988, 1993 The Regents of the University of California. |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
34,11 → 35,96 |
*/ |
#include <string.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <ctype.h> |
#include <limits.h> |
#include <ctype.h> |
#include <align.h> |
#include <sys/types.h> |
#include <malloc.h> |
/* Dummy implementation of mem/ functions */ |
void *memset(void *s, int c, size_t n) |
{ |
char *os = s; |
while (n--) |
*(os++) = c; |
return s; |
} |
struct along { |
unsigned long n; |
} __attribute__ ((packed)); |
static void *unaligned_memcpy(void *dst, const void *src, size_t n) |
{ |
int i, j; |
struct along *adst = dst; |
const struct along *asrc = src; |
for (i = 0; i < n / sizeof(unsigned long); i++) |
adst[i].n = asrc[i].n; |
for (j = 0; j < n % sizeof(unsigned long); j++) |
((unsigned char *) (((unsigned long *) dst) + i))[j] = |
((unsigned char *) (((unsigned long *) src) + i))[j]; |
return (char *) dst; |
} |
void *memcpy(void *dst, const void *src, size_t n) |
{ |
int i, j; |
if (((long) dst & (sizeof(long) - 1)) || |
((long) src & (sizeof(long) - 1))) |
return unaligned_memcpy(dst, src, n); |
for (i = 0; i < n / sizeof(unsigned long); i++) |
((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; |
for (j = 0; j < n % sizeof(unsigned long); j++) |
((unsigned char *) (((unsigned long *) dst) + i))[j] = |
((unsigned char *) (((unsigned long *) src) + i))[j]; |
return (char *) dst; |
} |
void *memmove(void *dst, const void *src, size_t n) |
{ |
int i, j; |
if (src > dst) |
return memcpy(dst, src, n); |
for (j = (n % sizeof(unsigned long)) - 1; j >= 0; j--) |
((unsigned char *) ((unsigned long *) dst))[j] = |
((unsigned char *) ((unsigned long *) src))[j]; |
for (i = n / sizeof(unsigned long) - 1; i >=0 ; i--) |
((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; |
return (char *) dst; |
} |
/** Compare two memory areas. |
* |
* @param s1 Pointer to the first area to compare. |
* @param s2 Pointer to the second area to compare. |
* @param len Size of the first area in bytes. Both areas must have |
* the same length. |
* @return If len is 0, return zero. If the areas match, return |
* zero. Otherwise return non-zero. |
*/ |
int bcmp(const char *s1, const char *s2, size_t len) |
{ |
for (; len && *s1++ == *s2++; len--) |
; |
return len; |
} |
/** Count the number of characters in the string, not including terminating 0. |
* |
* @param str String. |
312,36 → 398,51 |
return (char *) memcpy(ret, s1, len); |
} |
char *strtok(char *s, const char *delim) |
/* Ported from FBSD strtok.c 8.1 (Berkeley) 6/4/93 */ |
char * strtok_r(char *s, const char *delim, char **last) |
{ |
static char *next; |
char *spanp, *tok; |
int c, sc; |
return strtok_r(s, delim, &next); |
} |
if (s == NULL && (s = *last) == NULL) |
return (NULL); |
char *strtok_r(char *s, const char *delim, char **next) |
{ |
char *start, *end; |
cont: |
c = *s++; |
for (spanp = (char *)delim; (sc = *spanp++) != 0;) { |
if (c == sc) |
goto cont; |
} |
if (s == NULL) |
s = *next; |
if (c == 0) { /* no non-delimiter characters */ |
*last = NULL; |
return (NULL); |
} |
/* Skip over leading delimiters. */ |
while (*s && (strchr(delim, *s) != NULL)) ++s; |
start = s; |
tok = s - 1; |
/* Skip over token characters. */ |
while (*s && (strchr(delim, *s) == NULL)) ++s; |
end = s; |
*next = (*s ? s + 1 : s); |
if (start == end) { |
return NULL; /* No more tokens. */ |
for (;;) { |
c = *s++; |
spanp = (char *)delim; |
do { |
if ((sc = *spanp++) == c) { |
if (c == 0) |
s = NULL; |
else |
s[-1] = '\0'; |
*last = s; |
return (tok); |
} |
} while (sc != 0); |
} |
} |
/* Overwrite delimiter with NULL terminator. */ |
*end = '\0'; |
return start; |
/* Ported from FBSD strtok.c 8.1 (Berkeley) 6/4/93 */ |
char * strtok(char *s, const char *delim) |
{ |
static char *last; |
return (strtok_r(s, delim, &last)); |
} |
/** @} |
/branches/dynload/uspace/lib/libc/Makefile |
---|
54,7 → 54,6 |
generic/ddi.c \ |
generic/as.c \ |
generic/cap.c \ |
generic/mem.c \ |
generic/string.c \ |
generic/fibril.c \ |
generic/pcb.c \ |
96,9 → 95,10 |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
PIC_OBJECTS := $(addsuffix .pio,$(basename $(OBJECTS))) |
OBJECTS = $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
PIC_OBJECTS = $(addsuffix .pio,$(basename $(OBJECTS))) |
.PHONY: all clean depend kerninc |
all: kerninc libc.a libc.pic.a arch/$(ARCH)/_link.ld |
/branches/dynload/uspace/lib/libc/include/mem.h |
---|
File deleted |
Property changes: |
Deleted: svn:mergeinfo |
/branches/dynload/uspace/lib/libc/include/loader/loader.h |
---|
44,7 → 44,7 |
int phone_id; |
} loader_t; |
extern loader_t *loader_spawn(const char *name); |
extern loader_t *loader_spawn(char *name); |
extern int loader_get_task_id(loader_t *, task_id_t *); |
extern int loader_set_pathname(loader_t *, const char *); |
extern int loader_set_args(loader_t *, char *const []); |
/branches/dynload/uspace/lib/libc/include/ipc/fb.h |
---|
51,6 → 51,7 |
FB_GET_RESOLUTION, |
FB_DRAW_TEXT_DATA, |
FB_FLUSH, |
FB_VIEWPORT_DB, |
FB_DRAW_PPM, |
FB_PREPARE_SHM, |
FB_DROP_SHM, |
58,6 → 59,7 |
FB_VP_DRAW_PIXMAP, |
FB_VP2PIXMAP, |
FB_DROP_PIXMAP, |
FB_TRANS_PUTCHAR, |
FB_ANIM_CREATE, |
FB_ANIM_DROP, |
FB_ANIM_ADDPIXMAP, |
/branches/dynload/uspace/lib/libc/include/string.h |
---|
35,9 → 35,16 |
#ifndef LIBC_STRING_H_ |
#define LIBC_STRING_H_ |
#include <mem.h> |
#include <sys/types.h> |
#define bzero(ptr, len) memset((ptr), 0, (len)) |
extern void * memset(void *, int, size_t); |
extern void * memcpy(void *, const void *, size_t); |
extern void * memmove(void *, const void *, size_t); |
extern int bcmp(const char *, const char *, size_t); |
extern int strcmp(const char *, const char *); |
extern int strncmp(const char *, const char *, size_t); |
extern int stricmp(const char *, const char *); |
/branches/dynload/uspace/app/init/Makefile |
---|
66,7 → 66,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/app/tester/Makefile |
---|
67,7 → 67,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/app/klog/Makefile |
---|
54,7 → 54,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/Makefile |
---|
92,6 → 92,8 |
build: $(BUILDS) |
clean: $(CLEANS) |
find $(DIRS) -name '*.o' -follow -exec rm \{\} \; |
find lib/libc -name "_link.ld" -exec rm \{\} \; |
distclean: clean |
-rm Makefile.config |
/branches/dynload/uspace/srv/pci/libpci/Makefile |
---|
3,8 → 3,6 |
# Modified and ported to HelenOS by Jakub Jermar |
include ../../../Makefile.config |
LIBC_PREFIX=$(shell cd ../../../lib/libc; pwd) |
include ../../../Makefile.config |
/branches/dynload/uspace/srv/pci/Makefile |
---|
55,7 → 55,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
$(MAKE) -C libpci clean |
depend: |
/branches/dynload/uspace/srv/kbd/Makefile |
---|
97,8 → 97,6 |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
.PHONY: all clean depend disasm links |
all: links $(OUTPUT) $(OUTPUT).disasm |
110,13 → 108,13 |
ln -sfn ../genarch/include include/genarch |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend include/arch include/genarch |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LD_SCRIPT) $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) $(LIBS) |
$(LD) -T $(LD_SCRIPT) $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
/branches/dynload/uspace/srv/console/console.c |
---|
86,7 → 86,10 |
* faster virtual console |
* switching */ |
static int kernel_pixmap = -1; /**< Number of fb pixmap, where kernel |
* console is stored */ |
/** Find unused virtual console. |
* |
*/ |
106,16 → 109,11 |
async_msg_0(fb_info.phone, FB_CLEAR); |
} |
static void curs_visibility(bool visible) |
static void curs_visibility(int v) |
{ |
async_msg_1(fb_info.phone, FB_CURSOR_VISIBILITY, visible); |
async_msg_1(fb_info.phone, FB_CURSOR_VISIBILITY, v); |
} |
static void curs_hide_sync(void) |
{ |
ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); |
} |
static void curs_goto(int row, int col) |
{ |
async_msg_2(fb_info.phone, FB_CURSOR_GOTO, row, col); |
189,80 → 187,114 |
} |
/** Save current screen to pixmap, draw old pixmap |
* |
* @param oldpixmap Old pixmap |
* @return ID of pixmap of current screen |
*/ |
static int switch_screens(int oldpixmap) |
{ |
int newpmap; |
/* Save screen */ |
newpmap = async_req_0_0(fb_info.phone, FB_VP2PIXMAP); |
if (newpmap < 0) |
return -1; |
if (oldpixmap != -1) { |
/* Show old screen */ |
async_msg_2(fb_info.phone, FB_VP_DRAW_PIXMAP, 0, oldpixmap); |
/* Drop old pixmap */ |
async_msg_1(fb_info.phone, FB_DROP_PIXMAP, oldpixmap); |
} |
return newpmap; |
} |
/** Switch to new console */ |
static void change_console(int newcons) |
{ |
connection_t *conn; |
static int console_pixmap = -1; |
int i, j, rc; |
keyfield_t *field; |
style_t *style; |
if (newcons == active_console) |
return; |
if (newcons == KERNEL_CONSOLE) { |
if (active_console == KERNEL_CONSOLE) |
return; |
active_console = KERNEL_CONSOLE; |
curs_visibility(0); |
async_serialize_start(); |
curs_hide_sync(); |
gcons_in_kernel(); |
if (kernel_pixmap == -1) { |
/* store/restore unsupported */ |
set_style_col(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND); |
clrscr(); |
} else { |
gcons_in_kernel(); |
console_pixmap = switch_screens(kernel_pixmap); |
kernel_pixmap = -1; |
} |
async_serialize_end(); |
if (__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE)) |
active_console = KERNEL_CONSOLE; |
else |
newcons = active_console; |
__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE); |
return; |
} |
async_serialize_start(); |
if (console_pixmap != -1) { |
kernel_pixmap = switch_screens(console_pixmap); |
console_pixmap = -1; |
} |
active_console = newcons; |
gcons_change_console(newcons); |
conn = &connections[active_console]; |
set_style(&conn->screenbuffer.style); |
curs_visibility(0); |
if (interbuffer) { |
for (i = 0; i < conn->screenbuffer.size_x; i++) |
for (j = 0; j < conn->screenbuffer.size_y; j++) { |
unsigned int size_x; |
size_x = conn->screenbuffer.size_x; |
interbuffer[i + j * size_x] = |
*get_field_at(&conn->screenbuffer, i, j); |
} |
/* This call can preempt, but we are already at the end */ |
rc = async_req_0_0(fb_info.phone, FB_DRAW_TEXT_DATA); |
} |
if (newcons != KERNEL_CONSOLE) { |
async_serialize_start(); |
if (active_console == KERNEL_CONSOLE) |
gcons_redraw_console(); |
active_console = newcons; |
gcons_change_console(newcons); |
conn = &connections[active_console]; |
if ((!interbuffer) || (rc != 0)) { |
set_style(&conn->screenbuffer.style); |
curs_visibility(false); |
if (interbuffer) { |
for (i = 0; i < conn->screenbuffer.size_x; i++) |
for (j = 0; j < conn->screenbuffer.size_y; j++) { |
unsigned int size_x; |
size_x = conn->screenbuffer.size_x; |
interbuffer[i + j * size_x] = |
*get_field_at(&conn->screenbuffer, i, j); |
} |
/* This call can preempt, but we are already at the end */ |
rc = async_req_0_0(fb_info.phone, FB_DRAW_TEXT_DATA); |
} |
if ((!interbuffer) || (rc != 0)) { |
set_style(&conn->screenbuffer.style); |
clrscr(); |
style = &conn->screenbuffer.style; |
for (j = 0; j < conn->screenbuffer.size_y; j++) |
for (i = 0; i < conn->screenbuffer.size_x; i++) { |
field = get_field_at(&conn->screenbuffer, i, j); |
if (!style_same(*style, field->style)) |
set_style(&field->style); |
style = &field->style; |
if ((field->character == ' ') && |
(style_same(field->style, |
conn->screenbuffer.style))) |
continue; |
prtchr(field->character, j, i); |
} |
} |
curs_goto(conn->screenbuffer.position_y, |
conn->screenbuffer.position_x); |
curs_visibility(conn->screenbuffer.is_cursor_visible); |
async_serialize_end(); |
clrscr(); |
style = &conn->screenbuffer.style; |
for (j = 0; j < conn->screenbuffer.size_y; j++) |
for (i = 0; i < conn->screenbuffer.size_x; i++) { |
field = get_field_at(&conn->screenbuffer, i, j); |
if (!style_same(*style, field->style)) |
set_style(&field->style); |
style = &field->style; |
if ((field->character == ' ') && |
(style_same(field->style, |
conn->screenbuffer.style))) |
continue; |
prtchr(field->character, j, i); |
} |
} |
curs_goto(conn->screenbuffer.position_y, |
conn->screenbuffer.position_x); |
curs_visibility(conn->screenbuffer.is_cursor_visible); |
async_serialize_end(); |
} |
/** Handler for keyboard */ |
465,6 → 497,7 |
async_new_connection(phonehash, 0, NULL, keyboard_events); |
/* Connect to framebuffer driver */ |
fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0, 0); |
while (fb_info.phone < 0) { |
usleep(10000); |
471,10 → 504,15 |
fb_info.phone = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0, 0); |
} |
/* Save old kernel screen */ |
kernel_pixmap = switch_screens(-1); |
/* Initialize gcons */ |
gcons_init(fb_info.phone); |
/* Synchronize, the gcons can have something in queue */ |
async_req_0_0(fb_info.phone, FB_FLUSH); |
/* Enable double buffering */ |
async_msg_2(fb_info.phone, FB_VIEWPORT_DB, (sysarg_t) -1, 1); |
async_req_0_2(fb_info.phone, FB_GET_CSIZE, &fb_info.rows, |
&fb_info.cols); |
/branches/dynload/uspace/srv/console/gcons.c |
---|
81,7 → 81,7 |
static void vp_switch(int vp) |
{ |
async_msg_1(fbphone, FB_VIEWPORT_SWITCH, vp); |
async_msg_1(fbphone,FB_VIEWPORT_SWITCH, vp); |
} |
/** Create view port */ |
105,7 → 105,7 |
/** Transparent putchar */ |
static void tran_putch(char c, int row, int col) |
{ |
async_msg_3(fbphone, FB_PUTCHAR, c, row, col); |
async_msg_3(fbphone, FB_TRANS_PUTCHAR, c, row, col); |
} |
/** Redraw the button showing state of a given console */ |
189,10 → 189,10 |
console_state[consnum] = CONS_DISCONNECTED_SEL; |
else |
console_state[consnum] = CONS_DISCONNECTED; |
if (active_console == KERNEL_CONSOLE) |
return; |
redraw_state(consnum); |
vp_switch(console_vp); |
} |
217,10 → 217,16 |
/** Change to kernel console */ |
void gcons_in_kernel(void) |
{ |
if (console_state[active_console] == CONS_DISCONNECTED_SEL) |
console_state[active_console] = CONS_DISCONNECTED; |
else |
console_state[active_console] = CONS_IDLE; |
redraw_state(active_console); |
if (animation != -1) |
async_msg_1(fbphone, FB_ANIM_STOP, animation); |
active_console = KERNEL_CONSOLE; |
active_console = KERNEL_CONSOLE; /* Set to kernel console */ |
vp_switch(0); |
} |
336,12 → 342,11 |
extern int _binary_helenos_ppm_size; |
extern char _binary_nameic_ppm_start[0]; |
extern int _binary_nameic_ppm_size; |
/** Redraws console graphics */ |
void gcons_redraw_console(void) |
/** Redraws console graphics */ |
static void gcons_redraw_console(void) |
{ |
int i; |
if (!use_gcons) |
return; |
352,7 → 357,7 |
(size_t) &_binary_helenos_ppm_size, xres - 66, 2); |
draw_pixmap(_binary_nameic_ppm_start, |
(size_t) &_binary_nameic_ppm_size, 5, 17); |
for (i = 0; i < CONSOLE_COUNT; i++) |
redraw_state(i); |
vp_switch(console_vp); |
454,16 → 459,16 |
int rc; |
int i; |
int status_start = STATUS_START; |
fbphone = phone; |
rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres); |
if (rc) |
return; |
if ((xres < 800) || (yres < 600)) |
if (xres < 800 || yres < 600) |
return; |
/* create console viewport */ |
/* Align width & height to character size */ |
console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP, |
501,12 → 506,13 |
ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED]; |
make_anim(); |
use_gcons = 1; |
console_state[0] = CONS_DISCONNECTED_SEL; |
console_state[KERNEL_CONSOLE] = CONS_KERNEL; |
gcons_redraw_console(); |
} |
/** @} |
*/ |
/branches/dynload/uspace/srv/console/Makefile |
---|
59,8 → 59,6 |
$(addsuffix .o,$(basename $(IMAGES))) |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
68,13 → 66,13 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
/branches/dynload/uspace/srv/console/gcons.h |
---|
36,7 → 36,6 |
#define _GCONS_H_ |
void gcons_init(int phone); |
void gcons_redraw_console(void); |
void gcons_change_console(int consnum); |
void gcons_notify_char(int consnum); |
void gcons_in_kernel(void); |
/branches/dynload/uspace/srv/console/screenbuffer.h |
---|
35,14 → 35,13 |
#ifndef __SCREENBUFFER_H__ |
#define __SCREENBUFFER_H__ |
#include <stdint.h> |
#define DEFAULT_FOREGROUND 0x0 /**< default console foreground color */ |
#define DEFAULT_BACKGROUND 0xf0f0f0 /**< default console background color */ |
typedef struct { |
uint32_t bg_color; /**< background color */ |
uint32_t fg_color; /**< foreground color */ |
unsigned int bg_color; /**< background color */ |
unsigned int fg_color; /**< foreground color */ |
} style_t; |
/** One field on screen. It contain one character and its attributes. */ |
/branches/dynload/uspace/srv/fb/ski.c |
---|
File deleted |
/branches/dynload/uspace/srv/fb/ski.h |
---|
File deleted |
/branches/dynload/uspace/srv/fb/serial_console.c |
---|
38,23 → 38,15 |
*/ |
#include <stdio.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <ipc/fb.h> |
#include <bool.h> |
#include <errno.h> |
#include "serial_console.h" |
#define MAX_CONTROL 20 |
static int width; |
static int height; |
static uint32_t width; |
static uint32_t height; |
static putc_function_t putc_function; |
/* Allow only 1 connection */ |
static int client_connected = 0; |
void serial_puts(char *str) |
{ |
while (*str) |
96,14 → 88,6 |
serial_puts(control); |
} |
/** Set scrolling region. */ |
void serial_set_scroll_region(unsigned last_row) |
{ |
char control[MAX_CONTROL]; |
snprintf(control, MAX_CONTROL, "\033[0;%ur", last_row); |
serial_puts(control); |
} |
void serial_cursor_disable(void) |
{ |
serial_puts("\033[?25l"); |
121,103 → 105,6 |
putc_function = putc_fn; |
} |
/** |
* Main function of the thread serving client connections. |
*/ |
void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
int retval; |
ipc_callid_t callid; |
ipc_call_t call; |
char c; |
int lastcol = 0; |
int lastrow = 0; |
int newcol; |
int newrow; |
int fgcolor; |
int bgcolor; |
int i; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
client_connected = 1; |
ipc_answer_0(iid, EOK); |
/* Clear the terminal, set scrolling region |
to 0 - height rows. */ |
serial_clrscr(); |
serial_goto(0, 0); |
serial_set_scroll_region(height); |
while (true) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = 0; |
ipc_answer_0(callid, EOK); |
return; |
case FB_PUTCHAR: |
c = IPC_GET_ARG1(call); |
newrow = IPC_GET_ARG2(call); |
newcol = IPC_GET_ARG3(call); |
if ((lastcol != newcol) || (lastrow != newrow)) |
serial_goto(newrow, newcol); |
lastcol = newcol + 1; |
lastrow = newrow; |
(*putc_function)(c); |
retval = 0; |
break; |
case FB_CURSOR_GOTO: |
newrow = IPC_GET_ARG1(call); |
newcol = IPC_GET_ARG2(call); |
serial_goto(newrow, newcol); |
lastrow = newrow; |
lastcol = newcol; |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, height, width); |
continue; |
case FB_CLEAR: |
serial_clrscr(); |
retval = 0; |
break; |
case FB_SET_STYLE: |
fgcolor = IPC_GET_ARG1(call); |
bgcolor = IPC_GET_ARG2(call); |
if (fgcolor < bgcolor) |
serial_set_style(0); |
else |
serial_set_style(7); |
retval = 0; |
break; |
case FB_SCROLL: |
i = IPC_GET_ARG1(call); |
if ((i > height) || (i < -height)) { |
retval = EINVAL; |
break; |
} |
serial_scroll(i); |
serial_goto(lastrow, lastcol); |
retval = 0; |
break; |
case FB_CURSOR_VISIBILITY: |
if(IPC_GET_ARG1(call)) |
serial_cursor_enable(); |
else |
serial_cursor_disable(); |
retval = 0; |
break; |
default: |
retval = ENOENT; |
} |
ipc_answer_0(callid, retval); |
} |
} |
/** |
* @} |
*/ |
/branches/dynload/uspace/srv/fb/msim.c |
---|
36,9 → 36,17 |
*/ |
#include <async.h> |
#include <ipc/fb.h> |
#include <ipc/ipc.h> |
#include <libc.h> |
#include <errno.h> |
#include <string.h> |
#include <libc.h> |
#include <stdio.h> |
#include <ipc/fb.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <align.h> |
#include <ddi.h> |
#include "serial_console.h" |
47,6 → 55,11 |
#define WIDTH 80 |
#define HEIGHT 25 |
#define MAX_CONTROL 20 |
/* Allow only 1 connection */ |
static int client_connected = 0; |
static char *virt_addr; |
static void msim_putc(const char c) |
54,6 → 67,100 |
*virt_addr = c; |
} |
static void msim_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
int retval; |
ipc_callid_t callid; |
ipc_call_t call; |
char c; |
int lastcol = 0; |
int lastrow = 0; |
int newcol; |
int newrow; |
int fgcolor; |
int bgcolor; |
int i; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
client_connected = 1; |
ipc_answer_0(iid, EOK); |
/* Clear the terminal, set scrolling region |
to 0 - 25 lines */ |
serial_clrscr(); |
serial_goto(0, 0); |
serial_puts("\033[0;25r"); |
while (true) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = 0; |
ipc_answer_0(callid, EOK); |
return; |
case FB_PUTCHAR: |
c = IPC_GET_ARG1(call); |
newrow = IPC_GET_ARG2(call); |
newcol = IPC_GET_ARG3(call); |
if ((lastcol != newcol) || (lastrow != newrow)) |
serial_goto(newrow, newcol); |
lastcol = newcol + 1; |
lastrow = newrow; |
msim_putc(c); |
retval = 0; |
break; |
case FB_CURSOR_GOTO: |
newrow = IPC_GET_ARG1(call); |
newcol = IPC_GET_ARG2(call); |
serial_goto(newrow, newcol); |
lastrow = newrow; |
lastcol = newcol; |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, HEIGHT, WIDTH); |
continue; |
case FB_CLEAR: |
serial_clrscr(); |
retval = 0; |
break; |
case FB_SET_STYLE: |
fgcolor = IPC_GET_ARG1(call); |
bgcolor = IPC_GET_ARG2(call); |
if (fgcolor < bgcolor) |
serial_set_style(0); |
else |
serial_set_style(7); |
retval = 0; |
break; |
case FB_SCROLL: |
i = IPC_GET_ARG1(call); |
if ((i > HEIGHT) || (i < -HEIGHT)) { |
retval = EINVAL; |
break; |
} |
serial_scroll(i); |
serial_goto(lastrow, lastcol); |
retval = 0; |
break; |
case FB_CURSOR_VISIBILITY: |
if(IPC_GET_ARG1(call)) |
serial_cursor_enable(); |
else |
serial_cursor_disable(); |
retval = 0; |
break; |
default: |
retval = ENOENT; |
} |
ipc_answer_0(callid, retval); |
} |
} |
int msim_init(void) |
{ |
void *phys_addr = (void *) sysinfo_value("fb.address.physical"); |
63,7 → 170,7 |
serial_console_init(msim_putc, WIDTH, HEIGHT); |
async_set_client_connection(serial_client_connection); |
async_set_client_connection(msim_client_connection); |
return 0; |
} |
/branches/dynload/uspace/srv/fb/serial_console.h |
---|
38,8 → 38,6 |
#ifndef FB_SERIAL_CONSOLE_H_ |
#define FB_SERIAL_CONSOLE_H_ |
#include <ipc/ipc.h> |
typedef void (*putc_function_t)(char); |
void serial_puts(char *str); |
49,9 → 47,6 |
void serial_set_style(const unsigned int mode); |
void serial_cursor_disable(void); |
void serial_cursor_enable(void); |
void serial_set_scroll_region(unsigned height); |
void serial_console_init(putc_function_t putc_fn, uint32_t w, uint32_t h); |
void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall); |
#endif |
/branches/dynload/uspace/srv/fb/main.c |
---|
38,7 → 38,6 |
#include "fb.h" |
#include "ega.h" |
#include "msim.h" |
#include "ski.h" |
#include "sgcn.h" |
#include "main.h" |
47,7 → 46,7 |
void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area) |
{ |
void *dest; |
dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) { |
if (*area) |
62,12 → 61,12 |
ipcarg_t phonead; |
bool initialized = false; |
#ifdef FB_ENABLED |
if (sysinfo_value("fb.kind") == 1) { |
if (fb_init() == 0) |
initialized = true; |
} |
} |
#endif |
#ifdef EGA_ENABLED |
if ((!initialized) && (sysinfo_value("fb.kind") == 2)) { |
87,22 → 86,15 |
initialized = true; |
} |
#endif |
#ifdef SKI_ENABLED |
if ((!initialized) && (sysinfo_value("fb") != true)) { |
if (ski_init() == 0) |
initialized = true; |
} |
#endif |
if (!initialized) |
return -1; |
if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Never reached */ |
return 0; |
} |
/branches/dynload/uspace/srv/fb/sgcn.c |
---|
36,6 → 36,8 |
*/ |
#include <async.h> |
#include <ipc/ipc.h> |
#include <ipc/fb.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <errno.h> |
58,6 → 60,9 |
*/ |
static uintptr_t sram_buffer_offset; |
/* Allow only 1 connection */ |
static int client_connected = 0; |
/** |
* SGCN buffer header. It is placed at the very beginning of the SGCN |
* buffer. |
117,6 → 122,103 |
} |
/** |
* Main function of the thread serving client connections. |
*/ |
static void sgcn_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
int retval; |
ipc_callid_t callid; |
ipc_call_t call; |
char c; |
int lastcol = 0; |
int lastrow = 0; |
int newcol; |
int newrow; |
int fgcolor; |
int bgcolor; |
int i; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
client_connected = 1; |
ipc_answer_0(iid, EOK); |
/* Clear the terminal, set scrolling region |
to 0 - 24 lines */ |
serial_clrscr(); |
serial_goto(0, 0); |
serial_puts("\033[0;24r"); |
while (true) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = 0; |
ipc_answer_0(callid, EOK); |
return; |
case FB_PUTCHAR: |
c = IPC_GET_ARG1(call); |
newrow = IPC_GET_ARG2(call); |
newcol = IPC_GET_ARG3(call); |
if ((lastcol != newcol) || (lastrow != newrow)) |
serial_goto(newrow, newcol); |
lastcol = newcol + 1; |
lastrow = newrow; |
sgcn_putc(c); |
retval = 0; |
break; |
case FB_CURSOR_GOTO: |
newrow = IPC_GET_ARG1(call); |
newcol = IPC_GET_ARG2(call); |
serial_goto(newrow, newcol); |
lastrow = newrow; |
lastcol = newcol; |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, HEIGHT, WIDTH); |
continue; |
case FB_CLEAR: |
serial_clrscr(); |
retval = 0; |
break; |
case FB_SET_STYLE: |
fgcolor = IPC_GET_ARG1(call); |
bgcolor = IPC_GET_ARG2(call); |
if (fgcolor < bgcolor) |
serial_set_style(0); |
else |
serial_set_style(7); |
retval = 0; |
break; |
case FB_SCROLL: |
i = IPC_GET_ARG1(call); |
if ((i > HEIGHT) || (i < -HEIGHT)) { |
retval = EINVAL; |
break; |
} |
serial_scroll(i); |
serial_goto(lastrow, lastcol); |
retval = 0; |
break; |
case FB_CURSOR_VISIBILITY: |
if(IPC_GET_ARG1(call)) |
serial_cursor_enable(); |
else |
serial_cursor_disable(); |
retval = 0; |
break; |
default: |
retval = ENOENT; |
} |
ipc_answer_0(callid, retval); |
} |
} |
/** |
* Initializes the SGCN serial driver. |
*/ |
int sgcn_init(void) |
138,7 → 240,7 |
sram_buffer_offset = sysinfo_value("sram.buffer.offset"); |
async_set_client_connection(serial_client_connection); |
async_set_client_connection(sgcn_client_connection); |
return 0; |
} |
/branches/dynload/uspace/srv/fb/Makefile |
---|
57,10 → 57,7 |
CFLAGS += -DEGA_ENABLED |
endif |
ifeq ($(ARCH), ia64) |
SOURCES += ega.c \ |
ski.c \ |
serial_console.c |
CFLAGS += -DSKI_ENABLED |
SOURCES += ega.c |
CFLAGS += -DEGA_ENABLED |
endif |
ifeq ($(ARCH), amd64) |
90,7 → 87,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/srv/fb/fb.c |
---|
1,5 → 1,4 |
/* |
* Copyright (c) 2008 Martin Decky |
* Copyright (c) 2006 Jakub Vana |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
33,7 → 32,7 |
* @brief HelenOS graphical framebuffer. |
* @ingroup fbs |
* @{ |
*/ |
*/ |
/** @file |
*/ |
63,354 → 62,427 |
#include "pointer.xbm" |
#include "pointer_mask.xbm" |
#define DEFAULT_BGCOLOR 0xf0f0f0 |
#define DEFAULT_FGCOLOR 0x000000 |
#define DEFAULT_BGCOLOR 0xf0f0f0 |
#define DEFAULT_FGCOLOR 0x0 |
#define MAX_ANIM_LEN 8 |
#define MAX_ANIMATIONS 4 |
#define MAX_PIXMAPS 256 /**< Maximum number of saved pixmaps */ |
#define MAX_VIEWPORTS 128 /**< Viewport is a rectangular area on the screen */ |
/***************************************************************/ |
/* Pixel specific fuctions */ |
typedef void (*rgb_conv_t)(void *, uint32_t); |
typedef void (*conv2scr_fn_t)(void *, int); |
typedef int (*conv2rgb_fn_t)(void *); |
struct { |
uint8_t *fb_addr; |
uint8_t *fbaddress; |
unsigned int xres; |
unsigned int yres; |
unsigned int scanline; |
unsigned int glyphscanline; |
unsigned int pixelbytes; |
unsigned int glyphbytes; |
rgb_conv_t rgb_conv; |
unsigned int invert_colors; |
conv2scr_fn_t rgb2scr; |
conv2rgb_fn_t scr2rgb; |
} screen; |
typedef struct { |
bool initialized; |
unsigned int x; |
unsigned int y; |
unsigned int width; |
unsigned int height; |
int initialized; |
unsigned int x, y; |
unsigned int width, height; |
/* Text support in window */ |
unsigned int cols; |
unsigned int rows; |
/* Style and glyphs for text printing */ |
unsigned int rows, cols; |
/* Style for text printing */ |
style_t style; |
uint8_t *glyphs; |
uint8_t *bgpixel; |
/* Auto-cursor position */ |
bool cursor_active; |
unsigned int cur_col; |
unsigned int cur_row; |
bool cursor_shown; |
/* Back buffer */ |
unsigned int bbsize; |
uint8_t *backbuf; |
int cursor_active, cur_col, cur_row; |
int cursor_shown; |
/* Double buffering */ |
uint8_t *dbdata; |
unsigned int dboffset; |
unsigned int paused; |
} viewport_t; |
#define MAX_ANIM_LEN 8 |
#define MAX_ANIMATIONS 4 |
typedef struct { |
bool initialized; |
bool enabled; |
int initialized; |
int enabled; |
unsigned int vp; |
unsigned int pos; |
unsigned int animlen; |
unsigned int pixmaps[MAX_ANIM_LEN]; |
} animation_t; |
static animation_t animations[MAX_ANIMATIONS]; |
static bool anims_enabled; |
static int anims_enabled; |
/** Maximum number of saved pixmaps |
* Pixmap is a saved rectangle |
*/ |
#define MAX_PIXMAPS 256 |
typedef struct { |
unsigned int width; |
unsigned int height; |
uint8_t *data; |
} pixmap_t; |
static pixmap_t pixmaps[MAX_PIXMAPS]; |
static pixmap_t pixmaps[MAX_PIXMAPS]; |
/* Viewport is a rectangular area on the screen */ |
#define MAX_VIEWPORTS 128 |
static viewport_t viewports[128]; |
static bool client_connected = false; /**< Allow only 1 connection */ |
/* Allow only 1 connection */ |
static int client_connected = 0; |
static void draw_glyph(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint8_t glyph); |
static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col, |
unsigned int row); |
#define RED(x, bits) ((x >> (16 + 8 - bits)) & ((1 << bits) - 1)) |
#define GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define COL_WIDTH 8 |
#define ROW_BYTES (screen.scanline * FONT_SCANLINES) |
#define RED(x, bits) ((x >> (8 + 8 + 8 - bits)) & ((1 << bits) - 1)) |
#define GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define POINTPOS(x, y) ((y) * screen.scanline + (x) * screen.pixelbytes) |
#define COL2X(col) ((col) * FONT_WIDTH) |
#define ROW2Y(row) ((row) * FONT_SCANLINES) |
static inline int COLOR(int color) |
{ |
return screen.invert_colors ? ~color : color; |
} |
#define X2COL(x) ((x) / FONT_WIDTH) |
#define Y2ROW(y) ((y) / FONT_SCANLINES) |
/* Conversion routines between different color representations */ |
static void |
rgb_byte0888(void *dst, int rgb) |
{ |
*(int *)dst = rgb; |
} |
#define FB_POS(x, y) ((y) * screen.scanline + (x) * screen.pixelbytes) |
#define BB_POS(vport, col, row) ((row) * vport->cols + (col)) |
#define GLYPH_POS(glyph, y, cursor) (((glyph) + (cursor) * FONT_GLYPHS) * screen.glyphbytes + (y) * screen.glyphscanline) |
static int |
byte0888_rgb(void *src) |
{ |
return (*(int *)src) & 0xffffff; |
} |
/** ARGB 8:8:8:8 conversion |
* |
*/ |
static void rgb_0888(void *dst, uint32_t rgb) |
static void |
bgr_byte0888(void *dst, int rgb) |
{ |
*((uint32_t *) dst) = rgb & 0xffffff; |
*((uint32_t *) dst) = BLUE(rgb, 8) << 16 | GREEN(rgb, 8) << 8 | |
RED(rgb, 8); |
} |
/** ABGR 8:8:8:8 conversion |
* |
*/ |
static void bgr_0888(void *dst, uint32_t rgb) |
static int |
byte0888_bgr(void *src) |
{ |
*((uint32_t *) dst) |
= (BLUE(rgb, 8) << 16) | (GREEN(rgb, 8) << 8) | RED(rgb, 8); |
int color = *(uint32_t *)(src); |
return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) | |
((color >> 16) & 0xff); |
} |
/** BGR 8:8:8 conversion |
* |
*/ |
static void rgb_888(void *dst, uint32_t rgb) |
static void |
rgb_byte888(void *dst, int rgb) |
{ |
uint8_t *scr = dst; |
#if defined(FB_INVERT_ENDIAN) |
((uint8_t *) dst)[0] = RED(rgb, 8); |
((uint8_t *) dst)[1] = GREEN(rgb, 8); |
((uint8_t *) dst)[2] = BLUE(rgb, 8); |
scr[0] = RED(rgb, 8); |
scr[1] = GREEN(rgb, 8); |
scr[2] = BLUE(rgb, 8); |
#else |
((uint8_t *) dst)[0] = BLUE(rgb, 8); |
((uint8_t *) dst)[1] = GREEN(rgb, 8); |
((uint8_t *) dst)[2] = RED(rgb, 8); |
scr[2] = RED(rgb, 8); |
scr[1] = GREEN(rgb, 8); |
scr[0] = BLUE(rgb, 8); |
#endif |
} |
static int |
byte888_rgb(void *src) |
{ |
uint8_t *scr = src; |
#if defined(FB_INVERT_ENDIAN) |
return scr[0] << 16 | scr[1] << 8 | scr[2]; |
#else |
return scr[2] << 16 | scr[1] << 8 | scr[0]; |
#endif |
} |
/** RGB 5:5:5 conversion |
* |
*/ |
static void rgb_555(void *dst, uint32_t rgb) |
/** 16-bit depth (5:5:5) */ |
static void |
rgb_byte555(void *dst, int rgb) |
{ |
*((uint16_t *) dst) |
= (RED(rgb, 5) << 10) | (GREEN(rgb, 5) << 5) | BLUE(rgb, 5); |
/* 5-bit, 5-bits, 5-bits */ |
*((uint16_t *)(dst)) = RED(rgb, 5) << 10 | GREEN(rgb, 5) << 5 | |
BLUE(rgb, 5); |
} |
/** 16-bit depth (5:5:5) */ |
static int |
byte555_rgb(void *src) |
{ |
int color = *(uint16_t *)(src); |
return (((color >> 10) & 0x1f) << (16 + 3)) | |
(((color >> 5) & 0x1f) << (8 + 3)) | ((color & 0x1f) << 3); |
} |
/** RGB 5:6:5 conversion |
* |
*/ |
static void rgb_565(void *dst, uint32_t rgb) |
/** 16-bit depth (5:6:5) */ |
static void |
rgb_byte565(void *dst, int rgb) |
{ |
*((uint16_t *) dst) |
= (RED(rgb, 5) << 11) | (GREEN(rgb, 6) << 5) | BLUE(rgb, 5); |
/* 5-bit, 6-bits, 5-bits */ |
*((uint16_t *)(dst)) = RED(rgb, 5) << 11 | GREEN(rgb, 6) << 5 | |
BLUE(rgb, 5); |
} |
/** 16-bit depth (5:6:5) */ |
static int |
byte565_rgb(void *src) |
{ |
int color = *(uint16_t *)(src); |
return (((color >> 11) & 0x1f) << (16 + 3)) | |
(((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3); |
} |
/** RGB 3:2:3 |
* |
*/ |
static void rgb_323(void *dst, uint32_t rgb) |
/** Put pixel - 8-bit depth (3:2:3) */ |
static void |
rgb_byte8(void *dst, int rgb) |
{ |
*((uint8_t *) dst) |
= ~((RED(rgb, 3) << 5) | (GREEN(rgb, 2) << 3) | BLUE(rgb, 3)); |
*(uint8_t *)dst = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | BLUE(rgb, 3); |
} |
/** Draw a filled rectangle. |
/** Return pixel color - 8-bit depth (3:2:3) */ |
static int |
byte8_rgb(void *src) |
{ |
int color = *(uint8_t *)src; |
return (((color >> 5) & 0x7) << (16 + 5)) | |
(((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5); |
} |
/** Put pixel into viewport |
* |
* @note Need real implementation that does not access VRAM twice. |
* @param vport Viewport identification |
* @param x X coord relative to viewport |
* @param y Y coord relative to viewport |
* @param color RGB color |
*/ |
static void draw_filled_rect(unsigned int x0, unsigned int y0, unsigned int x1, |
unsigned int y1, uint32_t color) |
static void |
putpixel(viewport_t *vport, unsigned int x, unsigned int y, int color) |
{ |
unsigned int x, y; |
unsigned int copy_bytes; |
int dx = vport->x + x; |
int dy = vport->y + y; |
uint8_t *sp, *dp; |
uint8_t cbuf[4]; |
if (! (vport->paused && vport->dbdata)) |
(*screen.rgb2scr)(&screen.fbaddress[POINTPOS(dx,dy)], |
COLOR(color)); |
if (y0 >= y1 || x0 >= x1) return; |
screen.rgb_conv(cbuf, color); |
sp = &screen.fb_addr[FB_POS(x0, y0)]; |
dp = sp; |
/* Draw the first line. */ |
for (x = x0; x < x1; x++) { |
memcpy(dp, cbuf, screen.pixelbytes); |
dp += screen.pixelbytes; |
if (vport->dbdata) { |
int dline = (y + vport->dboffset) % vport->height; |
int doffset = screen.pixelbytes * (dline * vport->width + x); |
(*screen.rgb2scr)(&vport->dbdata[doffset], COLOR(color)); |
} |
} |
dp = sp + screen.scanline; |
copy_bytes = (x1 - x0) * screen.pixelbytes; |
/** Get pixel from viewport */ |
static int |
getpixel(viewport_t *vport, unsigned int x, unsigned int y) |
{ |
int dx = vport->x + x; |
int dy = vport->y + y; |
/* Draw the remaining lines by copying. */ |
for (y = y0 + 1; y < y1; y++) { |
memcpy(dp, sp, copy_bytes); |
dp += screen.scanline; |
} |
return COLOR((*screen.scr2rgb)(&screen.fbaddress[POINTPOS(dx, dy)])); |
} |
/** Redraw viewport. |
* |
* @param vport Viewport to redraw |
* |
*/ |
static void vport_redraw(viewport_t *vport) |
static inline void |
putpixel_mem(char *mem, unsigned int x, unsigned int y, int color) |
{ |
unsigned int row, col; |
(*screen.rgb2scr)(&mem[POINTPOS(x, y)], COLOR(color)); |
} |
for (row = 0; row < vport->rows; row++) { |
for (col = 0; col < vport->cols; col++) { |
draw_vp_glyph(vport, false, col, row); |
static void |
draw_rectangle(viewport_t *vport, unsigned int sx, unsigned int sy, |
unsigned int width, unsigned int height, int color) |
{ |
unsigned int x, y; |
static void *tmpline; |
if (!tmpline) |
tmpline = malloc(screen.scanline * screen.pixelbytes); |
/* Clear first line */ |
for (x = 0; x < width; x++) |
putpixel_mem(tmpline, x, 0, color); |
if (!vport->paused) { |
/* Recompute to screen coords */ |
sx += vport->x; |
sy += vport->y; |
/* Copy the rest */ |
for (y = sy;y < sy+height; y++) |
memcpy(&screen.fbaddress[POINTPOS(sx,y)], tmpline, |
screen.pixelbytes * width); |
} |
if (vport->dbdata) { |
for (y = sy; y < sy + height; y++) { |
int rline = (y + vport->dboffset) % vport->height; |
int rpos = (rline * vport->width + sx) * |
screen.pixelbytes; |
memcpy(&vport->dbdata[rpos], tmpline, |
screen.pixelbytes * width); |
} |
} |
if (COL2X(vport->cols) < vport->width) { |
draw_filled_rect( |
vport->x + COL2X(vport->cols), vport->y, |
vport->x + vport->width, vport->y + vport->height, |
vport->style.bg_color); |
} |
if (ROW2Y(vport->rows) < vport->height) { |
draw_filled_rect( |
vport->x, vport->y + ROW2Y(vport->rows), |
vport->x + vport->width, vport->y + vport->height, |
vport->style.bg_color); |
} |
} |
/** Clear viewport. |
* |
* @param vport Viewport to clear |
* |
*/ |
static void vport_clear(viewport_t *vport) |
/** Fill viewport with background color */ |
static void |
clear_port(viewport_t *vport) |
{ |
memset(vport->backbuf, 0, vport->bbsize); |
vport_redraw(vport); |
draw_rectangle(vport, 0, 0, vport->width, vport->height, |
vport->style.bg_color); |
} |
/** Scroll viewport by the specified number of lines. |
/** Scroll unbuffered viewport up/down |
* |
* @param vport Viewport to scroll |
* @param lines Number of lines to scroll |
* |
* @param lines Positive number - scroll up, negative - scroll down |
*/ |
static void vport_scroll(viewport_t *vport, int lines) |
static void |
scroll_port_nodb(viewport_t *vport, int lines) |
{ |
unsigned int row, col; |
unsigned int x, y; |
uint8_t glyph; |
int y; |
/* |
* Redraw. |
*/ |
if (lines > 0) { |
for (y = vport->y; y < vport->y+vport->height - lines; y++) |
memcpy(&screen.fbaddress[POINTPOS(vport->x,y)], |
&screen.fbaddress[POINTPOS(vport->x,y + lines)], |
screen.pixelbytes * vport->width); |
draw_rectangle(vport, 0, vport->height - lines, vport->width, |
lines, vport->style.bg_color); |
} else if (lines < 0) { |
lines = -lines; |
for (y = vport->y + vport->height-1; y >= vport->y + lines; y--) |
memcpy(&screen.fbaddress[POINTPOS(vport->x,y)], |
&screen.fbaddress[POINTPOS(vport->x,y - lines)], |
screen.pixelbytes * vport->width); |
draw_rectangle(vport, 0, 0, vport->width, lines, |
vport->style.bg_color); |
} |
} |
y = vport->y; |
for (row = 0; row < vport->rows; row++) { |
x = vport->x; |
for (col = 0; col < vport->cols; col++) { |
if ((row + lines >= 0) && (row + lines < vport->rows)) { |
glyph = vport->backbuf[BB_POS(vport, col, row + lines)]; |
/** Refresh given viewport from double buffer */ |
static void |
refresh_viewport_db(viewport_t *vport) |
{ |
unsigned int y, srcy, srcoff, dsty, dstx; |
if (vport->backbuf[BB_POS(vport, col, row)] == glyph) { |
x += FONT_WIDTH; |
continue; |
} |
} else { |
glyph = 0; |
} |
for (y = 0; y < vport->height; y++) { |
srcy = (y + vport->dboffset) % vport->height; |
srcoff = (vport->width * srcy) * screen.pixelbytes; |
draw_glyph(x, y, false, vport->glyphs, glyph); |
x += FONT_WIDTH; |
} |
y += FONT_SCANLINES; |
dstx = vport->x; |
dsty = vport->y + y; |
memcpy(&screen.fbaddress[POINTPOS(dstx,dsty)], |
&vport->dbdata[srcoff], vport->width * screen.pixelbytes); |
} |
} |
/* |
* Scroll backbuffer. |
*/ |
/** Scroll viewport that has double buffering enabled */ |
static void |
scroll_port_db(viewport_t *vport, int lines) |
{ |
++vport->paused; |
if (lines > 0) { |
draw_rectangle(vport, 0, 0, vport->width, lines, |
vport->style.bg_color); |
vport->dboffset += lines; |
vport->dboffset %= vport->height; |
} else if (lines < 0) { |
lines = -lines; |
draw_rectangle(vport, 0, vport->height-lines, vport->width, |
lines, vport->style.bg_color); |
if (lines > 0) { |
memmove(vport->backbuf, vport->backbuf + vport->cols * lines, |
vport->cols * (vport->rows - lines)); |
memset(&vport->backbuf[BB_POS(vport, 0, vport->rows - lines)], |
0, vport->cols * lines); |
} else { |
memmove(vport->backbuf - vport->cols * lines, vport->backbuf, |
vport->cols * (vport->rows + lines)); |
memset(vport->backbuf, 0, - vport->cols * lines); |
if (vport->dboffset < lines) |
vport->dboffset += vport->height; |
vport->dboffset -= lines; |
} |
--vport->paused; |
refresh_viewport_db(vport); |
} |
/** Render glyphs |
/** Scrolls viewport given number of lines */ |
static void |
scroll_port(viewport_t *vport, int lines) |
{ |
if (vport->dbdata) |
scroll_port_db(vport, lines); |
else |
scroll_port_nodb(vport, lines); |
} |
static void |
invert_pixel(viewport_t *vport, unsigned int x, unsigned int y) |
{ |
putpixel(vport, x, y, ~getpixel(vport, x, y)); |
} |
/***************************************************************/ |
/* Character-console functions */ |
/** Draw character at given position |
* |
* Convert glyphs from device independent font |
* description to current visual representation. |
* |
* @param vport Viewport |
* |
* @param vport Viewport where the character is printed |
* @param sx Coordinates of top-left of the character |
* @param sy Coordinates of top-left of the character |
* @param style Color of the character |
* @param transparent If false, print background color |
*/ |
static void render_glyphs(viewport_t* vport) |
static void |
draw_glyph(viewport_t *vport,uint8_t glyph, unsigned int sx, unsigned int sy, |
style_t style, int transparent) |
{ |
unsigned int glyph; |
for (glyph = 0; glyph < FONT_GLYPHS; glyph++) { |
unsigned int y; |
for (y = 0; y < FONT_SCANLINES; y++) { |
unsigned int x; |
for (x = 0; x < FONT_WIDTH; x++) { |
screen.rgb_conv(&vport->glyphs[GLYPH_POS(glyph, y, false) + x * screen.pixelbytes], |
(fb_font[glyph * FONT_SCANLINES + y] & (1 << (7 - x))) |
? vport->style.fg_color : vport->style.bg_color); |
uint32_t curcolor; |
if (y < FONT_SCANLINES - 2) |
curcolor = |
(fb_font[glyph * FONT_SCANLINES + y] & (1 << (7 - x))) |
? vport->style.fg_color : vport->style.bg_color; |
else |
curcolor = vport->style.fg_color; |
screen.rgb_conv(&vport->glyphs[GLYPH_POS(glyph, y, true) + x * screen.pixelbytes], curcolor); |
} |
int i; |
unsigned int y; |
unsigned int glline; |
for (y = 0; y < FONT_SCANLINES; y++) { |
glline = fb_font[glyph * FONT_SCANLINES + y]; |
for (i = 0; i < 8; i++) { |
if (glline & (1 << (7 - i))) |
putpixel(vport, sx + i, sy + y, style.fg_color); |
else if (!transparent) |
putpixel(vport, sx + i, sy + y, style.bg_color); |
} |
} |
screen.rgb_conv(vport->bgpixel, vport->style.bg_color); |
} |
/** Invert character at given position */ |
static void |
invert_char(viewport_t *vport,unsigned int row, unsigned int col) |
{ |
unsigned int x; |
unsigned int y; |
for (x = 0; x < COL_WIDTH; x++) |
for (y = 0; y < FONT_SCANLINES; y++) |
invert_pixel(vport, col * COL_WIDTH + x, row * |
FONT_SCANLINES + y); |
} |
/***************************************************************/ |
/* Stdout specific functions */ |
/** Create new viewport |
* |
* @param x Origin of the viewport (x). |
* @param y Origin of the viewport (y). |
* @param width Width of the viewport. |
* @param height Height of the viewport. |
* |
* @return New viewport number. |
* |
* @return New viewport number |
*/ |
static int vport_create(unsigned int x, unsigned int y, |
unsigned int width, unsigned int height) |
static int |
viewport_create(unsigned int x, unsigned int y,unsigned int width, |
unsigned int height) |
{ |
unsigned int i; |
int i; |
for (i = 0; i < MAX_VIEWPORTS; i++) { |
if (!viewports[i].initialized) |
break; |
417,102 → 489,75 |
} |
if (i == MAX_VIEWPORTS) |
return ELIMIT; |
unsigned int cols = width / FONT_WIDTH; |
unsigned int rows = height / FONT_SCANLINES; |
unsigned int bbsize = cols * rows; |
unsigned int glyphsize = 2 * FONT_GLYPHS * screen.glyphbytes; |
uint8_t *backbuf = (uint8_t *) malloc(bbsize); |
if (!backbuf) |
return ENOMEM; |
uint8_t *glyphs = (uint8_t *) malloc(glyphsize); |
if (!glyphs) { |
free(backbuf); |
return ENOMEM; |
} |
uint8_t *bgpixel = (uint8_t *) malloc(screen.pixelbytes); |
if (!bgpixel) { |
free(glyphs); |
free(backbuf); |
return ENOMEM; |
} |
memset(backbuf, 0, bbsize); |
memset(glyphs, 0, glyphsize); |
memset(bgpixel, 0, screen.pixelbytes); |
viewports[i].x = x; |
viewports[i].y = y; |
viewports[i].width = width; |
viewports[i].height = height; |
viewports[i].cols = cols; |
viewports[i].rows = rows; |
viewports[i].rows = height / FONT_SCANLINES; |
viewports[i].cols = width / COL_WIDTH; |
viewports[i].style.bg_color = DEFAULT_BGCOLOR; |
viewports[i].style.fg_color = DEFAULT_FGCOLOR; |
viewports[i].glyphs = glyphs; |
viewports[i].bgpixel = bgpixel; |
viewports[i].cur_col = 0; |
viewports[i].cur_row = 0; |
viewports[i].cursor_active = false; |
viewports[i].cursor_shown = false; |
viewports[i].bbsize = bbsize; |
viewports[i].backbuf = backbuf; |
viewports[i].initialized = true; |
render_glyphs(&viewports[i]); |
viewports[i].cursor_active = 0; |
viewports[i].initialized = 1; |
return i; |
} |
/** Initialize framebuffer as a chardev output device |
* |
* @param addr Address of the framebuffer |
* @param xres Screen width in pixels |
* @param yres Screen height in pixels |
* @param visual Bits per pixel (8, 16, 24, 32) |
* @param scan Bytes per one scanline |
* @param addr Address of theframebuffer |
* @param xres Screen width in pixels |
* @param yres Screen height in pixels |
* @param visual Bits per pixel (8, 16, 24, 32) |
* @param scan Bytes per one scanline |
* @param invert_colors Inverted colors. |
* |
*/ |
static bool screen_init(void *addr, unsigned int xres, unsigned int yres, |
unsigned int scan, unsigned int visual) |
static bool |
screen_init(void *addr, unsigned int xres, unsigned int yres, |
unsigned int scan, unsigned int visual, bool invert_colors) |
{ |
switch (visual) { |
case VISUAL_INDIRECT_8: |
screen.rgb_conv = rgb_323; |
screen.rgb2scr = rgb_byte8; |
screen.scr2rgb = byte8_rgb; |
screen.pixelbytes = 1; |
break; |
case VISUAL_RGB_5_5_5: |
screen.rgb_conv = rgb_555; |
screen.rgb2scr = rgb_byte555; |
screen.scr2rgb = byte555_rgb; |
screen.pixelbytes = 2; |
break; |
case VISUAL_RGB_5_6_5: |
screen.rgb_conv = rgb_565; |
screen.rgb2scr = rgb_byte565; |
screen.scr2rgb = byte565_rgb; |
screen.pixelbytes = 2; |
break; |
case VISUAL_RGB_8_8_8: |
screen.rgb_conv = rgb_888; |
screen.rgb2scr = rgb_byte888; |
screen.scr2rgb = byte888_rgb; |
screen.pixelbytes = 3; |
break; |
case VISUAL_RGB_8_8_8_0: |
screen.rgb_conv = rgb_888; |
screen.rgb2scr = rgb_byte888; |
screen.scr2rgb = byte888_rgb; |
screen.pixelbytes = 4; |
break; |
case VISUAL_RGB_0_8_8_8: |
screen.rgb_conv = rgb_0888; |
screen.rgb2scr = rgb_byte0888; |
screen.scr2rgb = byte0888_rgb; |
screen.pixelbytes = 4; |
break; |
case VISUAL_BGR_0_8_8_8: |
screen.rgb_conv = bgr_0888; |
screen.rgb2scr = bgr_byte0888; |
screen.scr2rgb = byte0888_bgr; |
screen.pixelbytes = 4; |
break; |
default: |
519,118 → 564,72 |
return false; |
} |
screen.fb_addr = (unsigned char *) addr; |
screen.fbaddress = (unsigned char *) addr; |
screen.xres = xres; |
screen.yres = yres; |
screen.scanline = scan; |
screen.invert_colors = invert_colors; |
screen.glyphscanline = FONT_WIDTH * screen.pixelbytes; |
screen.glyphbytes = screen.glyphscanline * FONT_SCANLINES; |
/* Create first viewport */ |
vport_create(0, 0, xres, yres); |
viewport_create(0, 0, xres, yres); |
return true; |
} |
/** Draw a glyph. |
* |
* @param x x coordinate of top-left corner on screen. |
* @param y y coordinate of top-left corner on screen. |
* @param cursor Draw glyph with cursor |
* @param glyphs Pointer to font bitmap. |
* @param glyph Code of the glyph to draw. |
* |
*/ |
static void draw_glyph(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint8_t glyph) |
/** Hide cursor if it is shown */ |
static void |
cursor_hide(viewport_t *vport) |
{ |
unsigned int yd; |
for (yd = 0; yd < FONT_SCANLINES; yd++) |
memcpy(&screen.fb_addr[FB_POS(x, y + yd)], |
&glyphs[GLYPH_POS(glyph, yd, cursor)], screen.glyphscanline); |
} |
/** Draw glyph at specified position in viewport. |
* |
* @param vport Viewport identification |
* @param cursor Draw glyph with cursor |
* @param col Screen position relative to viewport |
* @param row Screen position relative to viewport |
* |
*/ |
static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col, |
unsigned int row) |
{ |
unsigned int x = vport->x + COL2X(col); |
unsigned int y = vport->y + ROW2Y(row); |
uint8_t glyph; |
glyph = vport->backbuf[BB_POS(vport, col, row)]; |
draw_glyph(x, y, cursor, vport->glyphs, glyph); |
} |
/** Hide cursor if it is shown |
* |
*/ |
static void cursor_hide(viewport_t *vport) |
{ |
if ((vport->cursor_active) && (vport->cursor_shown)) { |
draw_vp_glyph(vport, false, vport->cur_col, vport->cur_row); |
vport->cursor_shown = false; |
if (vport->cursor_active && vport->cursor_shown) { |
invert_char(vport, vport->cur_row, vport->cur_col); |
vport->cursor_shown = 0; |
} |
} |
/** Show cursor if cursor showing is enabled |
* |
*/ |
static void cursor_show(viewport_t *vport) |
/** Show cursor if cursor showing is enabled */ |
static void |
cursor_print(viewport_t *vport) |
{ |
/* Do not check for cursor_shown */ |
if (vport->cursor_active) { |
draw_vp_glyph(vport, true, vport->cur_col, vport->cur_row); |
vport->cursor_shown = true; |
invert_char(vport, vport->cur_row, vport->cur_col); |
vport->cursor_shown = 1; |
} |
} |
/** Invert cursor, if it is enabled |
* |
*/ |
static void cursor_blink(viewport_t *vport) |
/** Invert cursor, if it is enabled */ |
static void |
cursor_blink(viewport_t *vport) |
{ |
if (vport->cursor_shown) |
cursor_hide(vport); |
else |
cursor_show(vport); |
cursor_print(vport); |
} |
/** Draw character at given position relative to viewport |
* |
* @param vport Viewport identification |
* @param c Character to draw |
* @param col Screen position relative to viewport |
* @param row Screen position relative to viewport |
* |
/** Draw character at given position relative to viewport |
* |
* @param vport Viewport identification |
* @param c Character to print |
* @param row Screen position relative to viewport |
* @param col Screen position relative to viewport |
* @param transparent If false, print background color with character |
*/ |
static void draw_char(viewport_t *vport, uint8_t c, unsigned int col, unsigned int row) |
static void |
draw_char(viewport_t *vport, char c, unsigned int row, unsigned int col, |
style_t style, int transparent) |
{ |
/* Do not hide cursor if we are going to overwrite it */ |
if ((vport->cursor_active) && (vport->cursor_shown) && |
((vport->cur_col != col) || (vport->cur_row != row))) |
cursor_hide(vport); |
/* Optimize - do not hide cursor if we are going to overwrite it */ |
if (vport->cursor_active && vport->cursor_shown && |
(vport->cur_col != col || vport->cur_row != row)) |
invert_char(vport, vport->cur_row, vport->cur_col); |
vport->backbuf[BB_POS(vport, col, row)] = c; |
draw_vp_glyph(vport, false, col, row); |
draw_glyph(vport, c, col * COL_WIDTH, row * FONT_SCANLINES, style, |
transparent); |
vport->cur_col = col; |
vport->cur_row = row; |
vport->cur_col++; |
if (vport->cur_col >= vport->cols) { |
vport->cur_col = 0; |
638,85 → 637,65 |
if (vport->cur_row >= vport->rows) |
vport->cur_row--; |
} |
cursor_show(vport); |
cursor_print(vport); |
} |
/** Draw text data to viewport |
* |
* @param vport Viewport id |
* @param data Text data fitting exactly into viewport |
* |
* @param data Text data fitting exactly into viewport |
*/ |
static void draw_text_data(viewport_t *vport, keyfield_t *data) |
static void |
draw_text_data(viewport_t *vport, keyfield_t *data) |
{ |
unsigned int i; |
int i; |
int col,row; |
clear_port(vport); |
for (i = 0; i < vport->cols * vport->rows; i++) { |
unsigned int col = i % vport->cols; |
unsigned int row = i / vport->cols; |
uint8_t glyph = vport->backbuf[BB_POS(vport, col, row)]; |
// TODO: use data[i].style |
if (glyph != data[i].character) { |
vport->backbuf[BB_POS(vport, col, row)] = data[i].character; |
draw_vp_glyph(vport, false, col, row); |
} |
if (data[i].character == ' ' && style_same(data[i].style, |
vport->style)) |
continue; |
col = i % vport->cols; |
row = i / vport->cols; |
draw_glyph(vport, data[i].character, col * COL_WIDTH, row * |
FONT_SCANLINES, data[i].style, style_same(data[i].style, |
vport->style)); |
} |
cursor_show(vport); |
cursor_print(vport); |
} |
static void putpixel_pixmap(void *data, unsigned int x, unsigned int y, uint32_t color) |
/** Return first free pixmap */ |
static int |
find_free_pixmap(void) |
{ |
int pm = *((int *) data); |
pixmap_t *pmap = &pixmaps[pm]; |
unsigned int pos = (y * pmap->width + x) * screen.pixelbytes; |
int i; |
screen.rgb_conv(&pmap->data[pos], color); |
for (i = 0;i < MAX_PIXMAPS;i++) |
if (!pixmaps[i].data) |
return i; |
return -1; |
} |
static void putpixel(void *data, unsigned int x, unsigned int y, uint32_t color) |
static void |
putpixel_pixmap(int pm, unsigned int x, unsigned int y, int color) |
{ |
viewport_t *vport = (viewport_t *) data; |
unsigned int dx = vport->x + x; |
unsigned int dy = vport->y + y; |
screen.rgb_conv(&screen.fb_addr[FB_POS(dx, dy)], color); |
} |
pixmap_t *pmap = &pixmaps[pm]; |
int pos = (y * pmap->width + x) * screen.pixelbytes; |
/** Return first free pixmap |
* |
*/ |
static int find_free_pixmap(void) |
{ |
unsigned int i; |
for (i = 0; i < MAX_PIXMAPS; i++) |
if (!pixmaps[i].data) |
return i; |
return -1; |
(*screen.rgb2scr)(&pmap->data[pos],COLOR(color)); |
} |
/** Create a new pixmap and return appropriate ID |
* |
*/ |
static int shm2pixmap(unsigned char *shm, size_t size) |
/** Create a new pixmap and return appropriate ID */ |
static int |
shm2pixmap(unsigned char *shm, size_t size) |
{ |
int pm; |
pixmap_t *pmap; |
pm = find_free_pixmap(); |
if (pm == -1) |
return ELIMIT; |
pmap = &pixmaps[pm]; |
if (ppm_get_data(shm, size, &pmap->width, &pmap->height)) |
725,19 → 704,19 |
pmap->data = malloc(pmap->width * pmap->height * screen.pixelbytes); |
if (!pmap->data) |
return ENOMEM; |
ppm_draw(shm, size, 0, 0, pmap->width, pmap->height, putpixel_pixmap, (void *) &pm); |
ppm_draw(shm, size, 0, 0, pmap->width, pmap->height, |
(putpixel_cb_t)putpixel_pixmap, (void *)pm); |
return pm; |
} |
/** Handle shared memory communication calls |
* |
* Protocol for drawing pixmaps: |
* - FB_PREPARE_SHM(client shm identification) |
* - IPC_M_AS_AREA_SEND |
* - FB_DRAW_PPM(startx, starty) |
* - FB_DRAW_PPM(startx,starty) |
* - FB_DROP_SHM |
* |
* Protocol for text drawing |
745,30 → 724,28 |
* - FB_DRAW_TEXT_DATA |
* |
* @param callid Callid of the current call |
* @param call Current call data |
* @param vp Active viewport |
* @param call Current call data |
* @param vp Active viewport |
* @return 0 if the call was not handled byt this function, 1 otherwise |
* |
* @return false if the call was not handled byt this function, true otherwise |
* |
* Note: this function is not threads safe, you would have |
* note: this function is not threads safe, you would have |
* to redefine static variables with __thread |
* |
*/ |
static bool shm_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
static int |
shm_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
static keyfield_t *interbuffer = NULL; |
static size_t intersize = 0; |
static unsigned char *shm = NULL; |
static ipcarg_t shm_id = 0; |
static size_t shm_size; |
bool handled = true; |
int retval = EOK; |
int handled = 1; |
int retval = 0; |
viewport_t *vport = &viewports[vp]; |
unsigned int x; |
unsigned int y; |
unsigned int x, y; |
switch (IPC_GET_METHOD(*call)) { |
case IPC_M_SHARE_OUT: |
/* We accept one area for data interchange */ |
775,20 → 752,19 |
if (IPC_GET_ARG1(*call) == shm_id) { |
void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
shm_size = IPC_GET_ARG2(*call); |
if (!ipc_answer_1(callid, EOK, (sysarg_t) dest)) |
if (!ipc_answer_1(callid, EOK, (sysarg_t) dest)) |
shm = dest; |
else |
shm_id = 0; |
if (shm[0] != 'P') |
return false; |
return true; |
while (1) |
; |
return 1; |
} else { |
intersize = IPC_GET_ARG2(*call); |
receive_comm_area(callid, call, (void *) &interbuffer); |
} |
return true; |
return 1; |
case FB_PREPARE_SHM: |
if (shm_id) |
retval = EBUSY; |
803,7 → 779,7 |
} |
shm_id = 0; |
break; |
case FB_SHM2PIXMAP: |
if (!shm) { |
retval = EINVAL; |
818,14 → 794,14 |
} |
x = IPC_GET_ARG1(*call); |
y = IPC_GET_ARG2(*call); |
if ((x > vport->width) || (y > vport->height)) { |
if (x > vport->width || y > vport->height) { |
retval = EINVAL; |
break; |
} |
ppm_draw(shm, shm_size, IPC_GET_ARG1(*call), |
IPC_GET_ARG2(*call), vport->width - x, vport->height - y, putpixel, (void *) vport); |
IPC_GET_ARG2(*call), vport->width - x, vport->height - y, |
(putpixel_cb_t)putpixel, vport); |
break; |
case FB_DRAW_TEXT_DATA: |
if (!interbuffer) { |
832,7 → 808,8 |
retval = EINVAL; |
break; |
} |
if (intersize < vport->cols * vport->rows * sizeof(*interbuffer)) { |
if (intersize < vport->cols * vport->rows * |
sizeof(*interbuffer)) { |
retval = EINVAL; |
break; |
} |
839,7 → 816,7 |
draw_text_data(vport, interbuffer); |
break; |
default: |
handled = false; |
handled = 0; |
} |
if (handled) |
847,39 → 824,41 |
return handled; |
} |
static void |
copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
{ |
int y; |
int tmp, srcrowsize; |
int realwidth, realheight, realrowsize; |
int width = vport->width; |
int height = vport->height; |
static void copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
{ |
unsigned int width = vport->width; |
unsigned int height = vport->height; |
if (width + vport->x > screen.xres) |
width = screen.xres - vport->x; |
if (height + vport->y > screen.yres) |
height = screen.yres - vport->y; |
unsigned int realwidth = pmap->width <= width ? pmap->width : width; |
unsigned int realheight = pmap->height <= height ? pmap->height : height; |
realwidth = pmap->width <= width ? pmap->width : width; |
realheight = pmap->height <= height ? pmap->height : height; |
srcrowsize = vport->width * screen.pixelbytes; |
realrowsize = realwidth * screen.pixelbytes; |
unsigned int srcrowsize = vport->width * screen.pixelbytes; |
unsigned int realrowsize = realwidth * screen.pixelbytes; |
unsigned int y; |
for (y = 0; y < realheight; y++) { |
unsigned int tmp = (vport->y + y) * screen.scanline + vport->x * screen.pixelbytes; |
memcpy(pmap->data + srcrowsize * y, screen.fb_addr + tmp, realrowsize); |
tmp = (vport->y + y) * screen.scanline + |
vport->x * screen.pixelbytes; |
memcpy(pmap->data + srcrowsize * y, screen.fbaddress + tmp, |
realrowsize); |
} |
} |
/** Save viewport to pixmap |
* |
*/ |
static int save_vp_to_pixmap(viewport_t *vport) |
/** Save viewport to pixmap */ |
static int |
save_vp_to_pixmap(viewport_t *vport) |
{ |
int pm; |
pixmap_t *pmap; |
pm = find_free_pixmap(); |
if (pm == -1) |
return ELIMIT; |
888,60 → 867,58 |
pmap->data = malloc(screen.pixelbytes * vport->width * vport->height); |
if (!pmap->data) |
return ENOMEM; |
pmap->width = vport->width; |
pmap->height = vport->height; |
copy_vp_to_pixmap(vport, pmap); |
return pm; |
} |
/** Draw pixmap on screen |
* |
* @param vp Viewport to draw on |
* @param pm Pixmap identifier |
* |
*/ |
static int draw_pixmap(int vp, int pm) |
{ |
pixmap_t *pmap = &pixmaps[pm]; |
viewport_t *vport = &viewports[vp]; |
unsigned int width = vport->width; |
unsigned int height = vport->height; |
int y; |
int tmp, srcrowsize; |
int realwidth, realheight, realrowsize; |
int width = vport->width; |
int height = vport->height; |
if (width + vport->x > screen.xres) |
width = screen.xres - vport->x; |
if (height + vport->y > screen.yres) |
height = screen.yres - vport->y; |
if (!pmap->data) |
return EINVAL; |
unsigned int realwidth = pmap->width <= width ? pmap->width : width; |
unsigned int realheight = pmap->height <= height ? pmap->height : height; |
unsigned int srcrowsize = vport->width * screen.pixelbytes; |
unsigned int realrowsize = realwidth * screen.pixelbytes; |
unsigned int y; |
realwidth = pmap->width <= width ? pmap->width : width; |
realheight = pmap->height <= height ? pmap->height : height; |
srcrowsize = vport->width * screen.pixelbytes; |
realrowsize = realwidth * screen.pixelbytes; |
for (y = 0; y < realheight; y++) { |
unsigned int tmp = (vport->y + y) * screen.scanline + vport->x * screen.pixelbytes; |
memcpy(screen.fb_addr + tmp, pmap->data + y * srcrowsize, realrowsize); |
tmp = (vport->y + y) * screen.scanline + |
vport->x * screen.pixelbytes; |
memcpy(screen.fbaddress + tmp, pmap->data + y * srcrowsize, |
realrowsize); |
} |
return EOK; |
return 0; |
} |
/** Tick animation one step forward |
* |
*/ |
static void anims_tick(void) |
/** Tick animation one step forward */ |
static void |
anims_tick(void) |
{ |
unsigned int i; |
int i; |
static int counts = 0; |
/* Limit redrawing */ |
950,36 → 927,37 |
return; |
for (i = 0; i < MAX_ANIMATIONS; i++) { |
if ((!animations[i].animlen) || (!animations[i].initialized) || |
(!animations[i].enabled)) |
if (!animations[i].animlen || !animations[i].initialized || |
!animations[i].enabled) |
continue; |
draw_pixmap(animations[i].vp, animations[i].pixmaps[animations[i].pos]); |
animations[i].pos = (animations[i].pos + 1) % animations[i].animlen; |
draw_pixmap(animations[i].vp, |
animations[i].pixmaps[animations[i].pos]); |
animations[i].pos = (animations[i].pos + 1) % |
animations[i].animlen; |
} |
} |
static unsigned int pointer_x; |
static unsigned int pointer_y; |
static bool pointer_shown, pointer_enabled; |
static int pointer_x, pointer_y; |
static int pointer_shown, pointer_enabled; |
static int pointer_vport = -1; |
static int pointer_pixmap = -1; |
static void mouse_show(void) |
static void |
mouse_show(void) |
{ |
int i, j; |
int visibility; |
int color; |
int bytepos; |
if ((pointer_shown) || (!pointer_enabled)) |
if (pointer_shown || !pointer_enabled) |
return; |
/* Save image under the pointer. */ |
/* Save image under the cursor */ |
if (pointer_vport == -1) { |
pointer_vport = vport_create(pointer_x, pointer_y, pointer_width, pointer_height); |
pointer_vport = viewport_create(pointer_x, pointer_y, |
pointer_width, pointer_height); |
if (pointer_vport < 0) |
return; |
} else { |
986,13 → 964,14 |
viewports[pointer_vport].x = pointer_x; |
viewports[pointer_vport].y = pointer_y; |
} |
if (pointer_pixmap == -1) |
pointer_pixmap = save_vp_to_pixmap(&viewports[pointer_vport]); |
else |
copy_vp_to_pixmap(&viewports[pointer_vport], &pixmaps[pointer_pixmap]); |
/* Draw mouse pointer. */ |
copy_vp_to_pixmap(&viewports[pointer_vport], |
&pixmaps[pointer_pixmap]); |
/* Draw cursor */ |
for (i = 0; i < pointer_height; i++) |
for (j = 0; j < pointer_width; j++) { |
bytepos = i * ((pointer_width - 1) / 8 + 1) + j / 8; |
1010,10 → 989,10 |
pointer_shown = 1; |
} |
static void mouse_hide(void) |
static void |
mouse_hide(void) |
{ |
/* Restore image under the pointer. */ |
/* Restore image under the cursor */ |
if (pointer_shown) { |
draw_pixmap(pointer_vport, pointer_pixmap); |
pointer_shown = 0; |
1020,8 → 999,8 |
} |
} |
static void mouse_move(unsigned int x, unsigned int y) |
static void |
mouse_move(unsigned int x, unsigned int y) |
{ |
mouse_hide(); |
pointer_x = x; |
1029,14 → 1008,14 |
mouse_show(); |
} |
static int anim_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
static int |
anim_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
bool handled = true; |
int retval = EOK; |
int i, nvp; |
int handled = 1; |
int retval = 0; |
int i,nvp; |
int newval; |
switch (IPC_GET_METHOD(*call)) { |
case FB_ANIM_CREATE: |
nvp = IPC_GET_ARG1(*call); |
1126,16 → 1105,14 |
return handled; |
} |
/** Handler for messages concerning pixmap handling */ |
static int |
pixmap_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
int handled = 1; |
int retval = 0; |
int i,nvp; |
/** Handler for messages concerning pixmap handling |
* |
*/ |
static int pixmap_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
bool handled = true; |
int retval = EOK; |
int i, nvp; |
switch (IPC_GET_METHOD(*call)) { |
case FB_VP_DRAW_PIXMAP: |
nvp = IPC_GET_ARG1(*call); |
1173,7 → 1150,7 |
default: |
handled = 0; |
} |
if (handled) |
ipc_answer_0(callid, retval); |
return handled; |
1183,34 → 1160,32 |
/** Function for handling connections to FB |
* |
*/ |
static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
static void |
fb_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
unsigned int vp = 0; |
viewport_t *vport = &viewports[vp]; |
ipc_callid_t callid; |
ipc_call_t call; |
int retval; |
int i; |
unsigned int row,col; |
char c; |
int vp = 0; |
viewport_t *vport = &viewports[0]; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
/* Accept connection */ |
client_connected = true; |
ipc_answer_0(iid, EOK); |
while (true) { |
ipc_callid_t callid; |
ipc_call_t call; |
int retval; |
unsigned int i; |
int scroll; |
uint8_t glyph; |
unsigned int row, col; |
if ((vport->cursor_active) || (anims_enabled)) |
client_connected = 1; |
ipc_answer_0(iid, EOK); /* Accept connection */ |
while (1) { |
if (vport->cursor_active || anims_enabled) |
callid = async_get_call_timeout(&call, 250000); |
else |
callid = async_get_call(&call); |
mouse_hide(); |
if (!callid) { |
cursor_blink(vport); |
1218,89 → 1193,105 |
mouse_show(); |
continue; |
} |
if (shm_handle(callid, &call, vp)) |
continue; |
if (pixmap_handle(callid, &call, vp)) |
continue; |
if (anim_handle(callid, &call, vp)) |
continue; |
switch (IPC_GET_METHOD(call)) { |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = false; |
/* Cleanup other viewports */ |
client_connected = 0; |
/* cleanup other viewports */ |
for (i = 1; i < MAX_VIEWPORTS; i++) |
vport->initialized = false; |
/* Exit thread */ |
return; |
vport->initialized = 0; |
return; /* Exit thread */ |
case FB_PUTCHAR: |
glyph = IPC_GET_ARG1(call); |
case FB_TRANS_PUTCHAR: |
c = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
col = IPC_GET_ARG3(call); |
if ((col >= vport->cols) || (row >= vport->rows)) { |
if (row >= vport->rows || col >= vport->cols) { |
retval = EINVAL; |
break; |
} |
ipc_answer_0(callid, EOK); |
draw_char(vport, glyph, col, row); |
/* Message already answered */ |
continue; |
draw_char(vport, c, row, col, vport->style, |
IPC_GET_METHOD(call) == FB_TRANS_PUTCHAR); |
continue; /* msg already answered */ |
case FB_CLEAR: |
vport_clear(vport); |
cursor_show(vport); |
retval = EOK; |
clear_port(vport); |
cursor_print(vport); |
retval = 0; |
break; |
case FB_CURSOR_GOTO: |
case FB_CURSOR_GOTO: |
row = IPC_GET_ARG1(call); |
col = IPC_GET_ARG2(call); |
if ((col >= vport->cols) || (row >= vport->rows)) { |
if (row >= vport->rows || col >= vport->cols) { |
retval = EINVAL; |
break; |
} |
retval = EOK; |
retval = 0; |
cursor_hide(vport); |
vport->cur_col = col; |
vport->cur_row = row; |
cursor_show(vport); |
break; |
cursor_print(vport); |
break; |
case FB_CURSOR_VISIBILITY: |
cursor_hide(vport); |
vport->cursor_active = IPC_GET_ARG1(call); |
cursor_show(vport); |
retval = EOK; |
cursor_print(vport); |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, vport->rows, vport->cols); |
continue; |
case FB_SCROLL: |
scroll = IPC_GET_ARG1(call); |
if ((scroll > (int) vport->rows) || (scroll < (-(int) vport->rows))) { |
i = IPC_GET_ARG1(call); |
if (i > vport->rows || i < (- (int)vport->rows)) { |
retval = EINVAL; |
break; |
} |
cursor_hide(vport); |
vport_scroll(vport, scroll); |
cursor_show(vport); |
retval = EOK; |
scroll_port(vport, i*FONT_SCANLINES); |
cursor_print(vport); |
retval = 0; |
break; |
case FB_VIEWPORT_DB: |
/* Enable double buffering */ |
i = IPC_GET_ARG1(call); |
if (i == -1) |
i = vp; |
if (i < 0 || i >= MAX_VIEWPORTS) { |
retval = EINVAL; |
break; |
} |
if (!viewports[i].initialized ) { |
retval = EADDRNOTAVAIL; |
break; |
} |
viewports[i].dboffset = 0; |
if (IPC_GET_ARG2(call) == 1 && !viewports[i].dbdata) |
viewports[i].dbdata = |
malloc(screen.pixelbytes * |
viewports[i].width * viewports[i].height); |
else if (IPC_GET_ARG2(call) == 0 && |
viewports[i].dbdata) { |
free(viewports[i].dbdata); |
viewports[i].dbdata = NULL; |
} |
retval = 0; |
break; |
case FB_VIEWPORT_SWITCH: |
i = IPC_GET_ARG1(call); |
if (i >= MAX_VIEWPORTS) { |
if (i < 0 || i >= MAX_VIEWPORTS) { |
retval = EINVAL; |
break; |
} |
if (!viewports[i].initialized) { |
if (! viewports[i].initialized ) { |
retval = EADDRNOTAVAIL; |
break; |
} |
1307,11 → 1298,11 |
cursor_hide(vport); |
vp = i; |
vport = &viewports[vp]; |
cursor_show(vport); |
retval = EOK; |
cursor_print(vport); |
retval = 0; |
break; |
case FB_VIEWPORT_CREATE: |
retval = vport_create(IPC_GET_ARG1(call) >> 16, |
retval = viewport_create(IPC_GET_ARG1(call) >> 16, |
IPC_GET_ARG1(call) & 0xffff, |
IPC_GET_ARG2(call) >> 16, |
IPC_GET_ARG2(call) & 0xffff); |
1318,36 → 1309,33 |
break; |
case FB_VIEWPORT_DELETE: |
i = IPC_GET_ARG1(call); |
if (i >= MAX_VIEWPORTS) { |
if (i < 0 || i >= MAX_VIEWPORTS) { |
retval = EINVAL; |
break; |
} |
if (!viewports[i].initialized) { |
if (! viewports[i].initialized ) { |
retval = EADDRNOTAVAIL; |
break; |
} |
viewports[i].initialized = false; |
if (viewports[i].glyphs) |
free(viewports[i].glyphs); |
if (viewports[i].bgpixel) |
free(viewports[i].bgpixel); |
if (viewports[i].backbuf) |
free(viewports[i].backbuf); |
retval = EOK; |
viewports[i].initialized = 0; |
if (viewports[i].dbdata) { |
free(viewports[i].dbdata); |
viewports[i].dbdata = NULL; |
} |
retval = 0; |
break; |
case FB_SET_STYLE: |
vport->style.fg_color = IPC_GET_ARG1(call); |
vport->style.bg_color = IPC_GET_ARG2(call); |
render_glyphs(vport); |
retval = EOK; |
retval = 0; |
break; |
case FB_GET_RESOLUTION: |
ipc_answer_2(callid, EOK, screen.xres, screen.yres); |
continue; |
case FB_POINTER_MOVE: |
pointer_enabled = true; |
pointer_enabled = 1; |
mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
retval = EOK; |
retval = 0; |
break; |
default: |
retval = ENOENT; |
1356,32 → 1344,41 |
} |
} |
/** Initialization of framebuffer |
* |
*/ |
int fb_init(void) |
/** Initialization of framebuffer */ |
int |
fb_init(void) |
{ |
void *fb_ph_addr; |
unsigned int fb_width; |
unsigned int fb_height; |
unsigned int fb_scanline; |
unsigned int fb_visual; |
bool fb_invert_colors; |
void *fb_addr; |
size_t asz; |
async_set_client_connection(fb_client_connection); |
fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
fb_width = sysinfo_value("fb.width"); |
fb_height = sysinfo_value("fb.height"); |
fb_scanline = sysinfo_value("fb.scanline"); |
fb_visual = sysinfo_value("fb.visual"); |
fb_invert_colors = sysinfo_value("fb.invert-colors"); |
asz = fb_scanline * fb_height; |
fb_addr = as_get_mappable_page(asz); |
void *fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
unsigned int fb_offset = sysinfo_value("fb.offset"); |
unsigned int fb_width = sysinfo_value("fb.width"); |
unsigned int fb_height = sysinfo_value("fb.height"); |
unsigned int fb_scanline = sysinfo_value("fb.scanline"); |
unsigned int fb_visual = sysinfo_value("fb.visual"); |
unsigned int fbsize = fb_scanline * fb_height; |
void *fb_addr = as_get_mappable_page(fbsize); |
physmem_map(fb_ph_addr + fb_offset, fb_addr, |
ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); |
if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) |
physmem_map(fb_ph_addr, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >> |
PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); |
if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual, |
fb_invert_colors)) |
return 0; |
return -1; |
} |
/** |
/** |
* @} |
*/ |
/branches/dynload/uspace/srv/fb/ppm.c |
---|
92,23 → 92,23 |
int i; |
unsigned int color; |
unsigned int coef; |
/* Read magic */ |
if ((data[0] != 'P') || (data[1] != '6')) |
if (data[0] != 'P' || data[1] != '6') |
return EINVAL; |
data += 2; |
data+=2; |
skip_whitespace(&data); |
read_num(&data, &width); |
skip_whitespace(&data); |
read_num(&data, &height); |
read_num(&data,&height); |
skip_whitespace(&data); |
read_num(&data, &maxcolor); |
read_num(&data,&maxcolor); |
data++; |
if ((maxcolor == 0) || (maxcolor > 255) || (width * height > datasz)) |
if (maxcolor == 0 || maxcolor > 255 || width * height > datasz) { |
return EINVAL; |
} |
coef = 255 / maxcolor; |
if (coef * maxcolor > 255) |
coef -= 1; |
125,6 → 125,6 |
(*putpixel)(vport, sx + (i % width), sy + (i / width), color); |
data += 3; |
} |
return 0; |
} |
/branches/dynload/uspace/srv/fb/font-8x16.h |
---|
29,11 → 29,9 |
#ifndef FB_FONT_8X16_H_ |
#define FB_FONT_8X16_H_ |
#define FONT_GLYPHS 256 |
#define FONT_WIDTH 8 |
#define FONT_SCANLINES 16 |
#define FONT_GLIPHS 256 |
#define FONT_SCANLINES 16 |
extern unsigned char fb_font[FONT_GLIPHS * FONT_SCANLINES]; |
extern unsigned char fb_font[FONT_GLYPHS * FONT_SCANLINES]; |
#endif |
/branches/dynload/uspace/srv/fb/fb.h |
---|
29,7 → 29,7 |
/** @addtogroup fb |
* @ingroup fbs |
* @{ |
*/ |
*/ |
/** @file |
*/ |
36,10 → 36,8 |
#ifndef FB_FB_H_ |
#define FB_FB_H_ |
#include <stdint.h> |
typedef void (* putpixel_cb_t)(void *, unsigned int, unsigned int, int); |
typedef void (* putpixel_cb_t)(void *, unsigned int, unsigned int, uint32_t); |
extern int fb_init(void); |
#endif |
/branches/dynload/uspace/srv/fb/font-8x16.c |
---|
28,7 → 28,7 |
#include "font-8x16.h" |
unsigned char fb_font[FONT_GLYPHS * FONT_SCANLINES] = { |
unsigned char fb_font[FONT_GLIPHS * FONT_SCANLINES] = { |
/* 0 0x00 '^@' */ |
0x00, /* 00000000 */ |
/branches/dynload/uspace/srv/fs/tmpfs/Makefile |
---|
62,7 → 62,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/srv/fs/fat/fat_ops.c |
---|
389,8 → 389,6 |
uint16_t bps; |
unsigned dps; |
unsigned blocks; |
fat_cluster_t mcl, lcl; |
int rc; |
futex_down(&childp->lock); |
if (childp->lnkcnt == 1) { |
439,36 → 437,19 |
} |
block_put(b); |
} |
j = 0; |
/* |
* We need to grow the parent in order to create a new unused dentry. |
*/ |
if (parentp->idx->pfc == FAT_CLST_ROOT) { |
/* Can't grow the root directory. */ |
futex_up(&parentp->idx->lock); |
return ENOSPC; |
} |
rc = fat_alloc_clusters(bs, parentp->idx->dev_handle, 1, &mcl, &lcl); |
if (rc != EOK) { |
futex_up(&parentp->idx->lock); |
return rc; |
} |
fat_append_clusters(bs, parentp, mcl); |
b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NOREAD); |
d = (fat_dentry_t *)b->data; |
/* |
* Clear all dentries in the block except for the first one (the first |
* dentry will be cleared in the next step). |
*/ |
memset(d + 1, 0, bps - sizeof(fat_dentry_t)); |
futex_up(&parentp->idx->lock); |
return ENOTSUP; /* XXX */ |
hit: |
/* |
* At this point we only establish the link between the parent and the |
* child. The dentry, except of the name and the extension, will remain |
* uninitialized until the corresponding node is synced. Thus the valid |
* dentry data is kept in the child node structure. |
* uninitialized until the the corresponding node is synced. Thus the |
* valid dentry data is kept in the child node structure. |
*/ |
memset(d, 0, sizeof(fat_dentry_t)); |
fat_dentry_name_set(d, name); |
/branches/dynload/uspace/srv/fs/fat/Makefile |
---|
64,7 → 64,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/srv/vfs/Makefile |
---|
59,7 → 59,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/srv/ns/Makefile |
---|
53,7 → 53,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/srv/rd/Makefile |
---|
53,7 → 53,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/uspace/srv/devmap/Makefile |
---|
57,7 → 57,7 |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
/branches/dynload/kernel/generic/src/interrupt/interrupt.c |
---|
109,10 → 109,8 |
panic("Unhandled exception %d.", n); |
} |
#ifdef CONFIG_KCONSOLE |
/** kconsole cmd - print all exceptions */ |
static int cmd_exc_print(cmd_arg_t *argv) |
static int exc_print_cmd(cmd_arg_t *argv) |
{ |
#if (IVT_ITEMS > 0) |
unsigned int i; |
160,18 → 158,15 |
return 1; |
} |
static cmd_info_t exc_info = { |
.name = "exc", |
.description = "Print exception table.", |
.func = cmd_exc_print, |
.func = exc_print_cmd, |
.help = NULL, |
.argc = 0, |
.argv = NULL |
}; |
#endif |
/** Initialize generic exception handling support */ |
void exc_init(void) |
{ |
180,11 → 175,9 |
for (i = 0; i < IVT_ITEMS; i++) |
exc_register(i, "undef", (iroutine) exc_undef); |
#ifdef CONFIG_KCONSOLE |
cmd_initialize(&exc_info); |
if (!cmd_register(&exc_info)) |
printf("Cannot register command %s\n", exc_info.name); |
#endif |
panic("could not register command %s\n", exc_info.name); |
} |
/** @} |
/branches/dynload/kernel/generic/src/proc/thread.c |
---|
211,7 → 211,7 |
void thread_init(void) |
{ |
THREAD = NULL; |
atomic_set(&nrdy, 0); |
atomic_set(&nrdy,0); |
thread_slab = slab_cache_create("thread_slab", sizeof(thread_t), 0, |
thr_constructor, thr_destructor, 0); |
/branches/dynload/kernel/generic/src/mm/as.c |
---|
146,12 → 146,8 |
AS_KERNEL = as_create(FLAG_AS_KERNEL); |
if (!AS_KERNEL) |
panic("Cannot create kernel address space\n"); |
panic("can't create kernel address space\n"); |
/* Make sure the kernel address space |
* reference count never drops to zero. |
*/ |
atomic_set(&AS_KERNEL->refcount, 1); |
} |
/** Create address space. |
180,7 → 176,7 |
#else |
page_table_create(flags); |
#endif |
return as; |
} |
773,12 → 769,11 |
* In order for this to work properly, this may copy the data |
* into private anonymous memory (unless it's already there). |
* |
* @param as Address space. |
* @param flags Flags of the area memory. |
* @param address Address within the area to be changed. |
* @param as Address space. |
* @param flags Flags of the area memory. |
* @param address Address withing the area to be changed. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int as_area_change_flags(as_t *as, int flags, uintptr_t address) |
{ |
790,7 → 785,7 |
uintptr_t *old_frame; |
index_t frame_idx; |
count_t used_pages; |
/* Flags for the new memory mapping */ |
page_flags = area_flags_to_page_flags(flags); |
804,7 → 799,7 |
return ENOENT; |
} |
if ((area->sh_info) || (area->backend != &anon_backend)) { |
if (area->sh_info || area->backend != &anon_backend) { |
/* Copying shared areas not supported yet */ |
/* Copying non-anonymous memory not supported yet */ |
mutex_unlock(&area->lock); |
875,7 → 870,6 |
*/ |
tlb_invalidate_pages(as->asid, area->base, area->pages); |
/* |
* Invalidate potential software translation caches (e.g. TSB on |
* sparc64). |
/branches/dynload/kernel/generic/src/syscall/syscall.c |
---|
92,12 → 92,8 |
/** Tell kernel to get keyboard/console access again */ |
static unative_t sys_debug_enable_console(void) |
{ |
#ifdef CONFIG_KCONSOLE |
arch_grab_console(); |
return true; |
#else |
return false; |
#endif |
return 0; |
} |
/** Print a hex integer into klog */ |
/branches/dynload/kernel/generic/src/udebug/udebug.c |
---|
72,7 → 72,7 |
ut->uspace_state = NULL; |
ut->go = false; |
ut->stoppable = true; |
ut->active = false; |
ut->debug_active = false; |
ut->cur_event = 0; /* none */ |
} |
112,7 → 112,7 |
bool res; |
mutex_lock(&THREAD->udebug.lock); |
res = THREAD->udebug.active; |
res = THREAD->udebug.debug_active; |
mutex_unlock(&THREAD->udebug.lock); |
return res; |
170,7 → 170,7 |
* Active debugging session |
*/ |
if (THREAD->udebug.active == true && |
if (THREAD->udebug.debug_active == true && |
THREAD->udebug.go == false) { |
/* |
* Thread was requested to stop - answer go call |
210,7 → 210,8 |
mutex_lock(&TASK->udebug.lock); |
mutex_lock(&THREAD->udebug.lock); |
if (THREAD->udebug.active && THREAD->udebug.go == false) { |
if (THREAD->udebug.debug_active && |
THREAD->udebug.go == false) { |
TASK->udebug.begin_call = NULL; |
mutex_unlock(&THREAD->udebug.lock); |
mutex_unlock(&TASK->udebug.lock); |
263,7 → 264,8 |
mutex_lock(&THREAD->udebug.lock); |
/* Must only generate events when in debugging session and is go. */ |
if (THREAD->udebug.active != true || THREAD->udebug.go == false || |
if (THREAD->udebug.debug_active != true || |
THREAD->udebug.go == false || |
(TASK->udebug.evmask & UDEBUG_EVMASK(etype)) == 0) { |
mutex_unlock(&THREAD->udebug.lock); |
mutex_unlock(&TASK->udebug.lock); |
332,9 → 334,9 |
LOG("- check state\n"); |
/* Must only generate events when in debugging session */ |
if (THREAD->udebug.active != true) { |
LOG("- udebug.active: %s, udebug.go: %s\n", |
THREAD->udebug.active ? "yes(+)" : "no(-)", |
if (THREAD->udebug.debug_active != true) { |
LOG("- debug_active: %s, udebug.go: %s\n", |
THREAD->udebug.debug_active ? "yes(+)" : "no(-)", |
THREAD->udebug.go ? "yes(-)" : "no(+)"); |
mutex_unlock(&THREAD->udebug.lock); |
mutex_unlock(&TASK->udebug.lock); |
382,9 → 384,9 |
LOG("- check state\n"); |
/* Must only generate events when in debugging session. */ |
if (THREAD->udebug.active != true) { |
/* printf("- udebug.active: %s, udebug.go: %s\n", |
THREAD->udebug.active ? "yes(+)" : "no(-)", |
if (THREAD->udebug.debug_active != true) { |
/* printf("- debug_active: %s, udebug.go: %s\n", |
THREAD->udebug.debug_active ? "yes(+)" : "no(-)", |
THREAD->udebug.go ? "yes(-)" : "no(+)");*/ |
mutex_unlock(&THREAD->udebug.lock); |
mutex_unlock(&TASK->udebug.lock); |
399,7 → 401,7 |
IPC_SET_ARG1(call->data, UDEBUG_EVENT_THREAD_E); |
/* Prevent any further debug activity in thread. */ |
THREAD->udebug.active = false; |
THREAD->udebug.debug_active = false; |
THREAD->udebug.cur_event = 0; /* none */ |
THREAD->udebug.go = false; /* set to initial value */ |
457,13 → 459,13 |
/* Only process userspace threads. */ |
if ((flags & THREAD_FLAG_USPACE) != 0) { |
/* Prevent any further debug activity in thread. */ |
t->udebug.active = false; |
t->udebug.debug_active = false; |
t->udebug.cur_event = 0; /* none */ |
/* Is the thread still go? */ |
if (t->udebug.go == true) { |
/* |
* Yes, so clear go. As active == false, |
* Yes, so clear go. As debug_active == false, |
* this doesn't affect anything. |
*/ |
t->udebug.go = false; |
/branches/dynload/kernel/generic/src/udebug/udebug_ops.c |
---|
58,7 → 58,7 |
* Specifically, verifies that thread t exists, is a userspace thread, |
* and belongs to the current task (TASK). Verifies, that the thread |
* is (or is not) go according to being_go (typically false). |
* It also locks t->udebug.lock, making sure that t->udebug.active |
* It also locks t->udebug.lock, making sure that t->udebug.debug_active |
* is true - that the thread is in a valid debugging session. |
* |
* With this verified and the t->udebug.lock mutex held, it is ensured |
108,7 → 108,7 |
} |
/* Verify debugging state. */ |
if (t->udebug.active != true) { |
if (t->udebug.debug_active != true) { |
/* Not in debugging session or undesired GO state */ |
spinlock_unlock(&t->lock); |
interrupts_restore(ipl); |
117,8 → 117,8 |
} |
/* |
* Since the thread has active == true, TASK->udebug.lock |
* is enough to ensure its existence and that active remains |
* Since the thread has debug_active == true, TASK->udebug.lock |
* is enough to ensure its existence and that debug_active remains |
* true. |
*/ |
spinlock_unlock(&t->lock); |
204,7 → 204,7 |
reply = 0; /* no reply */ |
} |
/* Set udebug.active on all of the task's userspace threads. */ |
/* Set udebug.debug_active on all of the task's userspace threads. */ |
for (cur = TASK->th_head.next; cur != &TASK->th_head; cur = cur->next) { |
t = list_get_instance(cur, thread_t, th_link); |
211,7 → 211,7 |
mutex_lock(&t->udebug.lock); |
if ((t->flags & THREAD_FLAG_USPACE) != 0) |
t->udebug.active = true; |
t->udebug.debug_active = true; |
mutex_unlock(&t->udebug.lock); |
} |
/branches/dynload/kernel/generic/src/main/main.c |
---|
191,6 → 191,8 |
{ |
/* Keep this the first thing. */ |
the_initialize(THE); |
LOG(); |
version_print(); |
198,8 → 200,8 |
"\nconfig.stack_base=%#" PRIp " config.stack_size=%" PRIs, |
config.base, config.kernel_size, config.stack_base, |
config.stack_size); |
#ifdef CONFIG_KCONSOLE |
/* |
* kconsole data structures must be initialized very early |
* because other subsystems will register their respective |
206,7 → 208,6 |
* commands. |
*/ |
LOG_EXEC(kconsole_init()); |
#endif |
/* |
* Exception handler initialization, before architecture |
251,7 → 252,7 |
if (init.cnt > 0) { |
count_t i; |
for (i = 0; i < init.cnt; i++) |
LOG("init[%" PRIc "].addr=%#" PRIp ", init[%" PRIc |
printf("init[%" PRIc "].addr=%#" PRIp ", init[%" PRIc |
"].size=%#" PRIs "\n", i, init.tasks[i].addr, i, |
init.tasks[i].size); |
} else |
270,8 → 271,8 |
/* |
* Create the first thread. |
*/ |
thread_t *kinit_thread |
= thread_create(kinit, NULL, kernel, 0, "kinit", true); |
thread_t *kinit_thread = thread_create(kinit, NULL, kernel, 0, "kinit", |
true); |
if (!kinit_thread) |
panic("Can't create kinit thread\n"); |
LOG_EXEC(thread_ready(kinit_thread)); |
/branches/dynload/kernel/generic/src/main/kinit.c |
---|
82,11 → 82,8 |
*/ |
void kinit(void *arg) |
{ |
thread_t *t; |
#if defined(CONFIG_SMP) || defined(CONFIG_KCONSOLE) |
thread_t *thread; |
#endif |
/* |
* Detach kinit as nobody will call thread_join_timeout() on it. |
*/ |
103,19 → 100,23 |
* not mess together with kcpulb threads. |
* Just a beautification. |
*/ |
thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true); |
if (thread != NULL) { |
spinlock_lock(&thread->lock); |
thread->cpu = &cpus[0]; |
spinlock_unlock(&thread->lock); |
thread_ready(thread); |
if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, |
"kmp", true))) { |
spinlock_lock(&t->lock); |
t->cpu = &cpus[0]; |
spinlock_unlock(&t->lock); |
thread_ready(t); |
} else |
panic("Unable to create kmp thread\n"); |
thread_join(thread); |
thread_detach(thread); |
panic("thread_create/kmp\n"); |
thread_join(t); |
thread_detach(t); |
} |
#endif /* CONFIG_SMP */ |
/* |
* Now that all CPUs are up, we can report what we've found. |
*/ |
cpu_list(); |
#ifdef CONFIG_SMP |
if (config.cpu_count > 1) { |
count_t i; |
124,37 → 125,35 |
* For each CPU, create its load balancing thread. |
*/ |
for (i = 0; i < config.cpu_count; i++) { |
thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true); |
if (thread != NULL) { |
spinlock_lock(&thread->lock); |
thread->cpu = &cpus[i]; |
spinlock_unlock(&thread->lock); |
thread_ready(thread); |
if ((t = thread_create(kcpulb, NULL, TASK, |
THREAD_FLAG_WIRED, "kcpulb", true))) { |
spinlock_lock(&t->lock); |
t->cpu = &cpus[i]; |
spinlock_unlock(&t->lock); |
thread_ready(t); |
} else |
printf("Unable to create kcpulb thread for cpu" PRIc "\n", i); |
panic("thread_create/kcpulb\n"); |
} |
} |
#endif /* CONFIG_SMP */ |
/* |
* At this point SMP, if present, is configured. |
*/ |
arch_post_smp_init(); |
#ifdef CONFIG_KCONSOLE |
if (stdin) { |
/* |
* Create kernel console. |
*/ |
thread = thread_create(kconsole_thread, NULL, TASK, 0, "kconsole", false); |
if (thread != NULL) |
thread_ready(thread); |
else |
printf("Unable to create kconsole thread\n"); |
} |
#endif /* CONFIG_KCONSOLE */ |
/* |
* Create kernel console. |
*/ |
t = thread_create(kconsole, (void *) "kconsole", TASK, 0, "kconsole", |
false); |
if (t) |
thread_ready(t); |
else |
panic("thread_create/kconsole\n"); |
interrupts_enable(); |
/* |
165,14 → 164,14 |
for (i = 0; i < init.cnt; i++) { |
if (init.tasks[i].addr % FRAME_SIZE) { |
printf("init[%" PRIc "].addr is not frame aligned\n", i); |
printf("init[%" PRIc "].addr is not frame aligned", i); |
continue; |
} |
int rc = program_create_from_image((void *) init.tasks[i].addr, |
"init-bin", &programs[i]); |
if ((rc == 0) && (programs[i].task != NULL)) { |
if (rc == 0 && programs[i].task != NULL) { |
/* |
* Set capabilities to init userspace tasks. |
*/ |
185,10 → 184,12 |
/* It was the program loader and was registered */ |
} else { |
/* RAM disk image */ |
int rd = init_rd((rd_header_t *) init.tasks[i].addr, init.tasks[i].size); |
int rd = init_rd((rd_header_t *) init.tasks[i].addr, |
init.tasks[i].size); |
if (rd != RE_OK) |
printf("Init binary %" PRIc " not used (error %d)\n", i, rd); |
printf("Init binary %" PRIc " not used, error " |
"code %d.\n", i, rd); |
} |
} |
202,18 → 203,12 |
} |
} |
#ifdef CONFIG_KCONSOLE |
if (!stdin) { |
printf("kinit: No stdin\nKernel alive: "); |
uint64_t i = 0; |
while (1) { |
printf(PRIu64 " ", i); |
thread_sleep(1); |
i++; |
printf("kinit... "); |
} |
} |
#endif /* CONFIG_KCONSOLE */ |
} |
/** @} |
/branches/dynload/kernel/generic/src/console/cmd.c |
---|
501,7 → 501,7 |
for (i = 0; basic_commands[i]; i++) { |
cmd_initialize(basic_commands[i]); |
if (!cmd_register(basic_commands[i])) |
printf("Cannot register command %s\n", basic_commands[i]->name); |
panic("could not register command %s\n", basic_commands[i]->name); |
} |
} |
/branches/dynload/kernel/generic/src/console/kconsole.c |
---|
401,15 → 401,11 |
return current; |
} |
/** Kernel console prompt. |
/** Kernel console managing thread. |
* |
* @param prompt Kernel console prompt (e.g kconsole/panic). |
* @param msg Message to display in the beginning. |
* @param kcon Wait for keypress to show the prompt |
* and never exit. |
* |
*/ |
void kconsole(char *prompt, char *msg, bool kcon) |
void kconsole(void *prompt) |
{ |
cmd_info_t *cmd_info; |
count_t len; |
416,42 → 412,25 |
char *cmdline; |
if (!stdin) { |
LOG("No stdin for kernel console"); |
printf("%s: no stdin\n", __func__); |
return; |
} |
if (msg) |
printf("%s", msg); |
if (kcon) |
_getc(stdin); |
while (true) { |
cmdline = clever_readline((char *) prompt, stdin); |
len = strlen(cmdline); |
if (!len) |
continue; |
cmd_info = parse_cmdline(cmdline, len); |
if (!cmd_info) |
continue; |
if ((!kcon) |
&& (strncmp(cmd_info->name, "exit", min(strlen(cmd_info->name), 5)) == 0)) |
if (strncmp(cmd_info->name, "exit", |
min(strlen(cmd_info->name), 5)) == 0) |
break; |
(void) cmd_info->func(cmd_info->argv); |
} |
} |
/** Kernel console managing thread. |
* |
*/ |
void kconsole_thread(void *data) |
{ |
kconsole("kconsole", "Kernel console ready (press any key to activate)\n", true); |
} |
static int parse_int_arg(char *text, size_t len, unative_t *result) |
{ |
static char symname[MAX_SYMBOL_NAME]; |
/branches/dynload/kernel/generic/src/console/console.c |
---|
167,7 → 167,7 |
printf("cpu%u: ", CPU->id); |
else |
printf("cpu: "); |
printf("halted (no kconsole)\n"); |
printf("halted - no kconsole\n"); |
cpu_halt(); |
} |
/branches/dynload/kernel/generic/src/lib/func.c |
---|
55,6 → 55,8 |
#ifdef CONFIG_DEBUG |
bool rundebugger = false; |
// TODO test_and_set not defined on all arches |
// if (!test_and_set(&haltstate)) |
if (!atomic_get(&haltstate)) { |
atomic_set(&haltstate, 1); |
rundebugger = true; |
64,12 → 66,12 |
#endif |
interrupts_disable(); |
#if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE)) |
if (rundebugger) |
kconsole("panic", "\nLast resort kernel console ready\n", false); |
#endif |
#ifdef CONFIG_DEBUG |
if (rundebugger) { |
printf("\n"); |
kconsole("panic"); /* Run kconsole as a last resort to user */ |
} |
#endif |
if (CPU) |
printf("cpu%u: halted\n", CPU->id); |
else |
/branches/dynload/kernel/generic/src/cpu/cpu.c |
---|
86,7 → 86,7 |
} |
#endif /* CONFIG_SMP */ |
CPU = &cpus[config.cpu_active - 1]; |
CPU = &cpus[config.cpu_active-1]; |
CPU->active = 1; |
CPU->tlb_active = 1; |
/branches/dynload/kernel/generic/include/udebug/udebug.h |
---|
177,9 → 177,9 |
/** What type of event are we stopped in or 0 if none. */ |
udebug_event_t cur_event; |
bool go; /**< thread is GO */ |
bool stoppable; /**< thread is stoppable */ |
bool active; /**< thread is in a debugging session */ |
bool go; /**< thread is GO */ |
bool stoppable; /**< thread is stoppable */ |
bool debug_active; /**< thread is in a debugging session */ |
} udebug_thread_t; |
struct task; |
/branches/dynload/kernel/generic/include/macros.h |
---|
45,8 → 45,8 |
#define isspace(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || \ |
((c) == '\r')) |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
#define min(a,b) ((a) < (b) ? (a) : (b)) |
#define max(a,b) ((a) > (b) ? (a) : (b)) |
/** Return true if the intervals overlap. |
* |
/branches/dynload/kernel/generic/include/console/kconsole.h |
---|
87,8 → 87,7 |
extern link_t cmd_head; |
extern void kconsole_init(void); |
extern void kconsole(char *prompt, char *msg, bool kcon); |
extern void kconsole_thread(void *data); |
extern void kconsole(void *prompt); |
extern int cmd_register(cmd_info_t *cmd); |
/branches/dynload/kernel/generic/include/debug.h |
---|
63,15 → 63,15 |
# define ASSERT(expr) |
#endif |
/** Extensive logging output macro |
/** Extensive debugging output macro |
* |
* If CONFIG_LOG is set, the LOG() macro |
* If CONFIG_EDEBUG is set, the LOG() macro |
* will print whatever message is indicated plus |
* an information about the location. |
* |
*/ |
#ifdef CONFIG_LOG |
#ifdef CONFIG_EDEBUG |
# define LOG(format, ...) \ |
printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \ |
__LINE__, ##__VA_ARGS__); |
79,15 → 79,15 |
# define LOG(format, ...) |
#endif |
/** Extensive logging execute macro |
/** Extensive debugging execute macro |
* |
* If CONFIG_LOG is set, the LOG_EXEC() macro |
* If CONFIG_EDEBUG is set, the LOG_EXEC() macro |
* will print an information about calling a given |
* function and call it. |
* |
*/ |
#ifdef CONFIG_LOG |
#ifdef CONFIG_EDEBUG |
# define LOG_EXEC(fnc) \ |
{ \ |
printf("%s() at %s:%u: " #fnc "\n", __func__, __FILE__, \ |
/branches/dynload/kernel/kernel.config |
---|
40,28 → 40,28 |
@ "sparc64" Sun UltraSPARC 64-bit |
! ARCH (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
@ "icc_native" ICC Native |
@ "suncc_native" Sun Studio C Compiler |
! [ARCH=amd64|ARCH=ia32|ARCH=ia32xen] COMPILER (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
@ "icc_native" ICC Native |
! [ARCH=ia64] COMPILER (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
@ "suncc_native" Sun Studio C Compiler |
! [ARCH=sparc64] COMPILER (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
@ "icc_native" ICC Native |
@ "suncc_native" Sun Studio C Compiler |
! [ARCH=amd64|ARCH=ia32|ARCH=ia32xen] COMPILER (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
@ "icc_native" ICC Native |
! [ARCH=ia64] COMPILER (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
@ "suncc_native" Sun Studio C Compiler |
! [ARCH=sparc64] COMPILER (choice) |
# Compiler |
@ "gcc_cross" GCC Cross-compiler |
@ "gcc_native" GCC Native |
! [ARCH=arm32|ARCH=mips32|ARCH=ppc32|ARCH=ppc64] COMPILER (choice) |
# CPU type |
143,7 → 143,7 |
# Support for Z8530 serial port |
! [ARCH=sparc64] CONFIG_Z8530 (y/n) |
# Support for NS16550 serial port |
# Support for NS16550 serial port |
! [ARCH=sparc64|(ARCH=ia64&MACHINE!=ski)] CONFIG_NS16550 (n/y) |
# Support for Serengeti console |
/branches/dynload/kernel/genarch/include/kbd/i8042.h |
---|
35,7 → 35,6 |
#ifndef KERN_I8042_H_ |
#define KERN_I8042_H_ |
#include <arch/types.h> |
#include <console/chardev.h> |
extern void i8042_init(devno_t kbd_devno, inr_t kbd_inr, devno_t mouse_devno, inr_t mouse_inr); |
/branches/dynload/kernel/genarch/include/fb/logo-196x66.h |
---|
File deleted |
Property changes: |
Deleted: svn:mergeinfo |
/branches/dynload/kernel/genarch/include/fb/visuals.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genarch |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
35,15 → 35,16 |
#ifndef KERN_VISUALS_H_ |
#define KERN_VISUALS_H_ |
#define VISUAL_INDIRECT_8 0 |
#define VISUAL_INDIRECT_8 0 |
#define VISUAL_RGB_5_5_5 1 |
#define VISUAL_RGB_5_6_5 2 |
#define VISUAL_RGB_8_8_8 3 |
#define VISUAL_RGB_8_8_8_0 4 |
#define VISUAL_RGB_0_8_8_8 5 |
#define VISUAL_RGB_5_5_5 1 |
#define VISUAL_RGB_5_6_5 2 |
#define VISUAL_RGB_8_8_8 3 |
#define VISUAL_RGB_8_8_8_0 4 |
#define VISUAL_RGB_0_8_8_8 5 |
#define VISUAL_BGR_0_8_8_8 6 |
#define VISUAL_BGR_0_8_8_8 6 |
#define VISUAL_SB1500_PALETTE 7 |
#endif |
/branches/dynload/kernel/genarch/include/fb/fb.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genarch |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
65,8 → 65,6 |
} fb_properties_t; |
SPINLOCK_EXTERN(fb_lock); |
void fb_redraw(void); |
void fb_init(fb_properties_t *props); |
#endif |
/branches/dynload/kernel/genarch/include/fb/font-8x16.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genarch |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
35,14 → 35,11 |
#ifndef KERN_FONT_8X16_H_ |
#define KERN_FONT_8X16_H_ |
#define FONT_GLYPHS 256 |
#define FONT_WIDTH 8 |
#define FONT_SCANLINES 16 |
#define FONT_GLIPHS 256 |
#define FONT_SCANLINES 16 |
#include <arch/types.h> |
extern unsigned char fb_font[FONT_GLIPHS * FONT_SCANLINES]; |
extern uint8_t fb_font[FONT_GLYPHS * FONT_SCANLINES]; |
#endif |
/** @} |
/branches/dynload/kernel/genarch/src/kbd/key.c |
---|
41,8 → 41,10 |
#endif |
#if (defined(sparc64)) |
#if (defined(CONFIG_Z8530) || defined(CONFIG_NS16550)) |
#include <genarch/kbd/scanc_sun.h> |
#endif |
#endif |
#include <synch/spinlock.h> |
#include <console/chardev.h> |
/branches/dynload/kernel/genarch/src/fb/logo-196x66.c |
---|
File deleted |
Property changes: |
Deleted: svn:mergeinfo |
/branches/dynload/kernel/genarch/src/fb/fb.c |
---|
1,5 → 1,4 |
/* |
* Copyright (c) 2008 Martin Decky |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
27,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genarch |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
34,7 → 33,6 |
*/ |
#include <genarch/fb/font-8x16.h> |
#include <genarch/fb/logo-196x66.h> |
#include <genarch/fb/visuals.h> |
#include <genarch/fb/fb.h> |
#include <console/chardev.h> |
41,7 → 39,6 |
#include <console/console.h> |
#include <sysinfo/sysinfo.h> |
#include <mm/slab.h> |
#include <align.h> |
#include <panic.h> |
#include <memstr.h> |
#include <config.h> |
50,114 → 47,137 |
#include <ddi/ddi.h> |
#include <arch/types.h> |
SPINLOCK_INITIALIZE(fb_lock); |
#include "helenos.xbm" |
/**< Physical memory area for fb. */ |
static parea_t fb_parea; |
static parea_t fb_parea; /**< Physical memory area for fb. */ |
static uint8_t *fb_addr; |
static uint8_t *backbuf; |
static uint8_t *glyphs; |
static uint8_t *bgscan; |
SPINLOCK_INITIALIZE(fb_lock); |
static unsigned int xres; |
static unsigned int yres; |
static uint8_t *fbaddress = NULL; |
static unsigned int ylogo; |
static unsigned int ytrim; |
static unsigned int rowtrim; |
static uint8_t *blankline = NULL; |
static uint8_t *dbbuffer = NULL; /* Buffer for fast scrolling console */ |
static index_t dboffset; |
static unsigned int scanline; |
static unsigned int glyphscanline; |
static unsigned int xres = 0; |
static unsigned int yres = 0; |
static unsigned int scanline = 0; |
static unsigned int pixelbytes = 0; |
#ifdef FB_INVERT_COLORS |
static bool invert_colors = true; |
#else |
static bool invert_colors = false; |
#endif |
static unsigned int pixelbytes; |
static unsigned int glyphbytes; |
static unsigned int bgscanbytes; |
static unsigned int cols; |
static unsigned int rows; |
static unsigned int position = 0; |
static unsigned int columns = 0; |
static unsigned int rows = 0; |
#define BG_COLOR 0x000080 |
#define FG_COLOR 0xffff00 |
#define COL_WIDTH 8 |
#define ROW_BYTES (scanline * FONT_SCANLINES) |
#define CURSOR 219 |
#define BGCOLOR 0x000080 |
#define FGCOLOR 0xffff00 |
#define LOGOCOLOR 0x2020b0 |
#define RED(x, bits) ((x >> (8 + 8 + 8 - bits)) & ((1 << bits) - 1)) |
#define GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define RED(x, bits) ((x >> (8 + 8 + 8 - bits)) & ((1 << bits) - 1)) |
#define GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define COL2X(col) ((col) * FONT_WIDTH) |
#define ROW2Y(row) ((row) * FONT_SCANLINES) |
#define POINTPOS(x, y) ((y) * scanline + (x) * pixelbytes) |
#define X2COL(x) ((x) / FONT_WIDTH) |
#define Y2ROW(y) ((y) / FONT_SCANLINES) |
/***************************************************************/ |
/* Pixel specific fuctions */ |
#define FB_POS(x, y) ((y) * scanline + (x) * pixelbytes) |
#define BB_POS(col, row) ((row) * cols + (col)) |
#define GLYPH_POS(glyph, y) ((glyph) * glyphbytes + (y) * glyphscanline) |
static void (*rgb2scr)(void *, int); |
static int (*scr2rgb)(void *); |
static inline int COLOR(int color) |
{ |
return invert_colors ? ~color : color; |
} |
static void (*rgb_conv)(void *, uint32_t); |
/* Conversion routines between different color representations */ |
static void rgb_byte0888(void *dst, int rgb) |
{ |
*((int *) dst) = rgb; |
} |
static int byte0888_rgb(void *src) |
{ |
return (*((int *) src)) & 0xffffff; |
} |
/** ARGB 8:8:8:8 conversion |
* |
*/ |
static void rgb_0888(void *dst, uint32_t rgb) |
static void bgr_byte0888(void *dst, int rgb) |
{ |
*((uint32_t *) dst) = rgb & 0xffffff; |
*((uint32_t *) dst) = BLUE(rgb, 8) << 16 | GREEN(rgb, 8) << 8 | |
RED(rgb, 8); |
} |
/** ABGR 8:8:8:8 conversion |
* |
*/ |
static void bgr_0888(void *dst, uint32_t rgb) |
static int byte0888_bgr(void *src) |
{ |
*((uint32_t *) dst) |
= (BLUE(rgb, 8) << 16) | (GREEN(rgb, 8) << 8) | RED(rgb, 8); |
int color = *(uint32_t *)(src); |
return ((color & 0xff) << 16) | (((color >> 8) & 0xff) << 8) | |
((color >> 16) & 0xff); |
} |
/** BGR 8:8:8 conversion |
* |
*/ |
static void rgb_888(void *dst, uint32_t rgb) |
static void rgb_byte888(void *dst, int rgb) |
{ |
uint8_t *scr = (uint8_t *) dst; |
#if defined(FB_INVERT_ENDIAN) |
((uint8_t *) dst)[0] = RED(rgb, 8); |
((uint8_t *) dst)[1] = GREEN(rgb, 8); |
((uint8_t *) dst)[2] = BLUE(rgb, 8); |
scr[0] = RED(rgb, 8); |
scr[1] = GREEN(rgb, 8); |
scr[2] = BLUE(rgb, 8); |
#else |
((uint8_t *) dst)[0] = BLUE(rgb, 8); |
((uint8_t *) dst)[1] = GREEN(rgb, 8); |
((uint8_t *) dst)[2] = RED(rgb, 8); |
scr[2] = RED(rgb, 8); |
scr[1] = GREEN(rgb, 8); |
scr[0] = BLUE(rgb, 8); |
#endif |
} |
static int byte888_rgb(void *src) |
{ |
uint8_t *scr = (uint8_t *) src; |
#if defined(FB_INVERT_ENDIAN) |
return scr[0] << 16 | scr[1] << 8 | scr[2]; |
#else |
return scr[2] << 16 | scr[1] << 8 | scr[0]; |
#endif |
} |
/** RGB 5:5:5 conversion |
* |
*/ |
static void rgb_555(void *dst, uint32_t rgb) |
/** 16-bit depth (5:5:5) */ |
static void rgb_byte555(void *dst, int rgb) |
{ |
*((uint16_t *) dst) |
= (RED(rgb, 5) << 10) | (GREEN(rgb, 5) << 5) | BLUE(rgb, 5); |
/* 5-bit, 5-bits, 5-bits */ |
*((uint16_t *) dst) = RED(rgb, 5) << 10 | GREEN(rgb, 5) << 5 | |
BLUE(rgb, 5); |
} |
/** 16-bit depth (5:5:5) */ |
static int byte555_rgb(void *src) |
{ |
int color = *(uint16_t *)(src); |
return (((color >> 10) & 0x1f) << (16 + 3)) | |
(((color >> 5) & 0x1f) << (8 + 3)) | ((color & 0x1f) << 3); |
} |
/** RGB 5:6:5 conversion |
* |
*/ |
static void rgb_565(void *dst, uint32_t rgb) |
/** 16-bit depth (5:6:5) */ |
static void rgb_byte565(void *dst, int rgb) |
{ |
*((uint16_t *) dst) |
= (RED(rgb, 5) << 11) | (GREEN(rgb, 6) << 5) | BLUE(rgb, 5); |
/* 5-bit, 6-bits, 5-bits */ |
*((uint16_t *) dst) = RED(rgb, 5) << 11 | GREEN(rgb, 6) << 5 | |
BLUE(rgb, 5); |
} |
/** 16-bit depth (5:6:5) */ |
static int byte565_rgb(void *src) |
{ |
int color = *(uint16_t *)(src); |
return (((color >> 11) & 0x1f) << (16 + 3)) | |
(((color >> 5) & 0x3f) << (8 + 2)) | ((color & 0x1f) << 3); |
} |
/** RGB 3:2:3 |
/** Put pixel - 8-bit depth (color palette/3:2:3) |
* |
* Even though we try 3:2:3 color scheme here, an 8-bit framebuffer |
* will most likely use a color palette. The color appearance |
164,117 → 184,228 |
* will be pretty random and depend on the default installed |
* palette. This could be fixed by supporting custom palette |
* and setting it to simulate the 8-bit truecolor. |
* |
* Currently we set the palette on the ia32, amd64 and sparc64 port. |
* |
* Note that the byte is being inverted by this function. The reason is |
* that we would like to use a color palette where the white color code |
* is 0 and the black color code is 255, as some machines (Sun Blade 1500) |
* use these codes for black and white and prevent to set codes |
* 0 and 255 to other colors. |
* |
*/ |
static void rgb_323(void *dst, uint32_t rgb) |
static void rgb_byte8(void *dst, int rgb) |
{ |
*((uint8_t *) dst) |
= ~((RED(rgb, 3) << 5) | (GREEN(rgb, 2) << 3) | BLUE(rgb, 3)); |
*((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | |
BLUE(rgb, 3); |
} |
static void sb1500rgb_byte8(void *dst, int rgb) |
{ |
if (RED(rgb, 1) && GREEN(rgb, 1) && BLUE(rgb, 1)) |
*((uint8_t *) dst) = 255; |
else if (RED(rgb, 1) && GREEN(rgb, 1)) |
*((uint8_t *) dst) = 150; |
else if (GREEN(rgb, 1) && BLUE(rgb, 1)) |
*((uint8_t *) dst) = 47; |
else if (RED(rgb, 1) && BLUE(rgb, 1)) |
*((uint8_t *) dst) = 48; |
else if (RED(rgb, 1)) |
*((uint8_t *) dst) = 32; |
else if (GREEN(rgb, 1)) |
*((uint8_t *) dst) = 47; |
else if (BLUE(rgb, 1)) |
*((uint8_t *) dst) = 2; |
else |
*((uint8_t *) dst) = 1; |
} |
/** Hide logo and refresh screen |
/** Return pixel color - 8-bit depth (color palette/3:2:3) |
* |
* See the comment for rgb_byte(). |
*/ |
static void logo_hide(void) |
static int byte8_rgb(void *src) |
{ |
ylogo = 0; |
ytrim = yres; |
rowtrim = rows; |
fb_redraw(); |
int color = *(uint8_t *)src; |
return (((color >> 5) & 0x7) << (16 + 5)) | |
(((color >> 3) & 0x3) << (8 + 6)) | ((color & 0x7) << 5); |
} |
static void putpixel(unsigned int x, unsigned int y, int color) |
{ |
(*rgb2scr)(&fbaddress[POINTPOS(x, y)], COLOR(color)); |
/** Draw character at given position |
* |
*/ |
static void glyph_draw(uint8_t glyph, unsigned int col, unsigned int row) |
if (dbbuffer) { |
int dline = (y + dboffset) % yres; |
(*rgb2scr)(&dbbuffer[POINTPOS(x, dline)], COLOR(color)); |
} |
} |
/** Get pixel from viewport */ |
static int getpixel(unsigned int x, unsigned int y) |
{ |
unsigned int x = COL2X(col); |
unsigned int y = ROW2Y(row); |
unsigned int yd; |
if (y >= ytrim) |
logo_hide(); |
backbuf[BB_POS(col, row)] = glyph; |
for (yd = 0; yd < FONT_SCANLINES; yd++) |
memcpy(&fb_addr[FB_POS(x, y + yd + ylogo)], |
&glyphs[GLYPH_POS(glyph, yd)], glyphscanline); |
if (dbbuffer) { |
int dline = (y + dboffset) % yres; |
return COLOR((*scr2rgb)(&dbbuffer[POINTPOS(x, dline)])); |
} |
return COLOR((*scr2rgb)(&fbaddress[POINTPOS(x, y)])); |
} |
/** Scroll screen down by one row |
* |
* |
*/ |
static void screen_scroll(void) |
/** Fill screen with background color */ |
static void clear_screen(void) |
{ |
if (ylogo > 0) { |
logo_hide(); |
return; |
unsigned int y; |
for (y = 0; y < yres; y++) { |
memcpy(&fbaddress[scanline * y], blankline, xres * pixelbytes); |
if (dbbuffer) |
memcpy(&dbbuffer[scanline * y], blankline, |
xres * pixelbytes); |
} |
unsigned int row; |
for (row = 0; row < rows; row++) { |
unsigned int y = ROW2Y(row); |
unsigned int yd; |
} |
/** Scroll screen one row up */ |
static void scroll_screen(void) |
{ |
if (dbbuffer) { |
count_t first; |
for (yd = 0; yd < FONT_SCANLINES; yd++) { |
unsigned int x; |
unsigned int col; |
for (col = 0, x = 0; col < cols; col++, |
x += FONT_WIDTH) { |
uint8_t glyph; |
if (row < rows - 1) { |
if (backbuf[BB_POS(col, row)] == |
backbuf[BB_POS(col, row + 1)]) |
continue; |
glyph = backbuf[BB_POS(col, row + 1)]; |
} else |
glyph = 0; |
memcpy(&fb_addr[FB_POS(x, y + yd)], |
&glyphs[GLYPH_POS(glyph, yd)], |
glyphscanline); |
} |
/* Clear the last row */ |
memcpy(&dbbuffer[dboffset * scanline], blankline, ROW_BYTES); |
dboffset = (dboffset + FONT_SCANLINES) % yres; |
first = yres - dboffset; |
/* Move all rows one row up */ |
if (xres * pixelbytes == scanline) { |
memcpy(fbaddress, &dbbuffer[dboffset * scanline], |
first * scanline); |
memcpy(&fbaddress[first * scanline], dbbuffer, |
dboffset * scanline); |
} else { |
/* |
* When the scanline is bigger than number of bytes |
* in the X-resolution, chances are that the |
* frame buffer memory past the X-resolution is special |
* in some way. For example, the SUNW,ffb framebuffer |
* wraps this area around the beginning of the same |
* line. To avoid troubles, copy only memory as |
* specified by the resolution. |
*/ |
unsigned int i; |
for (i = 0; i < first; i++) |
memcpy(&fbaddress[i * scanline], |
&dbbuffer[(dboffset + i) * scanline], |
xres * pixelbytes); |
for (i = 0; i < dboffset; i++) |
memcpy(&fbaddress[(first + i) * scanline], |
&dbbuffer[i * scanline], xres * pixelbytes); |
} |
} else { |
uint8_t *lastline = &fbaddress[(rows - 1) * ROW_BYTES]; |
if (xres * pixelbytes == scanline) { |
/* Move all rows one row up */ |
memcpy((void *) fbaddress, |
(void *) &fbaddress[ROW_BYTES], |
scanline * yres - ROW_BYTES); |
/* Clear the last row */ |
memcpy((void *) lastline, (void *) blankline, |
ROW_BYTES); |
} else { |
/* |
* See the comment in the dbbuffer case. |
*/ |
unsigned int i; |
/* Move all rows one row up */ |
for (i = 0; i < yres - FONT_SCANLINES; i++) |
memcpy(&fbaddress[i * scanline], |
&fbaddress[(i + FONT_SCANLINES) * scanline], |
xres * pixelbytes); |
/* Clear the last row */ |
for (i = 0; i < FONT_SCANLINES; i++) |
memcpy(&lastline[i * scanline], |
&blankline[i * scanline], |
xres * pixelbytes); |
} |
} |
memcpy(backbuf, backbuf + cols, cols * (rows - 1)); |
memsetb(&backbuf[BB_POS(0, rows - 1)], cols, 0); |
} |
static void cursor_put(void) |
static void invert_pixel(unsigned int x, unsigned int y) |
{ |
glyph_draw(CURSOR, position % cols, position / cols); |
putpixel(x, y, ~getpixel(x, y)); |
} |
static void cursor_remove(void) |
/** Draw one line of glyph at a given position */ |
static void draw_glyph_line(unsigned int glline, unsigned int x, unsigned int y) |
{ |
glyph_draw(0, position % cols, position / cols); |
unsigned int i; |
for (i = 0; i < 8; i++) |
if (glline & (1 << (7 - i))) { |
putpixel(x + i, y, FGCOLOR); |
} else |
putpixel(x + i, y, BGCOLOR); |
} |
/***************************************************************/ |
/* Character-console functions */ |
/** Draw character at given position */ |
static void draw_glyph(uint8_t glyph, unsigned int col, unsigned int row) |
{ |
unsigned int y; |
for (y = 0; y < FONT_SCANLINES; y++) |
draw_glyph_line(fb_font[glyph * FONT_SCANLINES + y], |
col * COL_WIDTH, row * FONT_SCANLINES + y); |
} |
/** Invert character at given position */ |
static void invert_char(unsigned int col, unsigned int row) |
{ |
unsigned int x; |
unsigned int y; |
for (x = 0; x < COL_WIDTH; x++) |
for (y = 0; y < FONT_SCANLINES; y++) |
invert_pixel(col * COL_WIDTH + x, |
row * FONT_SCANLINES + y); |
} |
/** Draw character at default position */ |
static void draw_char(char chr) |
{ |
draw_glyph(chr, position % columns, position / columns); |
} |
static void draw_logo(unsigned int startx, unsigned int starty) |
{ |
unsigned int x; |
unsigned int y; |
unsigned int byte; |
unsigned int rowbytes; |
rowbytes = (helenos_width - 1) / 8 + 1; |
for (y = 0; y < helenos_height; y++) |
for (x = 0; x < helenos_width; x++) { |
byte = helenos_bits[rowbytes * y + x / 8]; |
byte >>= x % 8; |
if (byte & 1) |
putpixel(startx + x, starty + y, |
COLOR(LOGOCOLOR)); |
} |
} |
/***************************************************************/ |
/* Stdout specific functions */ |
static void invert_cursor(void) |
{ |
invert_char(position % columns, position / columns); |
} |
/** Print character to screen |
* |
* Emulate basic terminal commands. |
* |
* Emulate basic terminal commands |
*/ |
static void fb_putchar(chardev_t *dev, char ch) |
{ |
282,38 → 413,37 |
switch (ch) { |
case '\n': |
cursor_remove(); |
position += cols; |
position -= position % cols; |
invert_cursor(); |
position += columns; |
position -= position % columns; |
break; |
case '\r': |
cursor_remove(); |
position -= position % cols; |
invert_cursor(); |
position -= position % columns; |
break; |
case '\b': |
cursor_remove(); |
if (position % cols) |
invert_cursor(); |
if (position % columns) |
position--; |
break; |
case '\t': |
cursor_remove(); |
invert_cursor(); |
do { |
glyph_draw((uint8_t) ' ', position % cols, |
position / cols); |
draw_char(' '); |
position++; |
} while ((position % 8) && (position < cols * rows)); |
} while ((position % 8) && position < columns * rows); |
break; |
default: |
glyph_draw((uint8_t) ch, position % cols, position / cols); |
draw_char(ch); |
position++; |
} |
if (position >= cols * rows) { |
position -= cols; |
screen_scroll(); |
if (position >= columns * rows) { |
position -= columns; |
scroll_screen(); |
} |
cursor_put(); |
invert_cursor(); |
spinlock_unlock(&fb_lock); |
} |
324,135 → 454,51 |
}; |
/** Render glyphs |
* |
* Convert glyphs from device independent font |
* description to current visual representation. |
* |
*/ |
static void glyphs_render(void) |
{ |
/* Prerender glyphs */ |
unsigned int glyph; |
for (glyph = 0; glyph < FONT_GLYPHS; glyph++) { |
unsigned int y; |
for (y = 0; y < FONT_SCANLINES; y++) { |
unsigned int x; |
for (x = 0; x < FONT_WIDTH; x++) { |
void *dst = &glyphs[GLYPH_POS(glyph, y) + |
x * pixelbytes]; |
uint32_t rgb = (fb_font[ROW2Y(glyph) + y] & |
(1 << (7 - x))) ? FG_COLOR : BG_COLOR; |
rgb_conv(dst, rgb); |
} |
} |
} |
/* Prerender background scanline */ |
unsigned int x; |
for (x = 0; x < xres; x++) |
rgb_conv(&bgscan[x * pixelbytes], BG_COLOR); |
} |
/** Refresh the screen |
* |
*/ |
void fb_redraw(void) |
{ |
if (ylogo > 0) { |
unsigned int y; |
for (y = 0; y < LOGO_HEIGHT; y++) { |
unsigned int x; |
for (x = 0; x < xres; x++) |
rgb_conv(&fb_addr[FB_POS(x, y)], |
(x < LOGO_WIDTH) ? |
fb_logo[y * LOGO_WIDTH + x] : |
LOGO_COLOR); |
} |
} |
unsigned int row; |
for (row = 0; row < rowtrim; row++) { |
unsigned int y = ylogo + ROW2Y(row); |
unsigned int yd; |
for (yd = 0; yd < FONT_SCANLINES; yd++) { |
unsigned int x; |
unsigned int col; |
for (col = 0, x = 0; col < cols; |
col++, x += FONT_WIDTH) { |
void *d = &fb_addr[FB_POS(x, y + yd)]; |
void *s = &glyphs[GLYPH_POS(backbuf[BB_POS(col, |
row)], yd)]; |
memcpy(d, s, glyphscanline); |
} |
} |
} |
if (COL2X(cols) < xres) { |
unsigned int y; |
unsigned int size = (xres - COL2X(cols)) * pixelbytes; |
for (y = ylogo; y < yres; y++) |
memcpy(&fb_addr[FB_POS(COL2X(cols), y)], bgscan, size); |
} |
if (ROW2Y(rowtrim) + ylogo < yres) { |
unsigned int y; |
for (y = ROW2Y(rowtrim) + ylogo; y < yres; y++) |
memcpy(&fb_addr[FB_POS(0, y)], bgscan, bgscanbytes); |
} |
} |
/** Initialize framebuffer as a chardev output device |
* |
* @param addr Physical address of the framebuffer |
* @param x Screen width in pixels |
* @param y Screen height in pixels |
* @param scan Bytes per one scanline |
* @param visual Color model |
* |
* @param props Properties of the framebuffer device. |
*/ |
void fb_init(fb_properties_t *props) |
{ |
switch (props->visual) { |
case VISUAL_INDIRECT_8: |
rgb_conv = rgb_323; |
rgb2scr = rgb_byte8; |
scr2rgb = byte8_rgb; |
pixelbytes = 1; |
break; |
case VISUAL_SB1500_PALETTE: |
rgb2scr = sb1500rgb_byte8; |
scr2rgb = byte8_rgb; |
pixelbytes = 1; |
break; |
case VISUAL_RGB_5_5_5: |
rgb_conv = rgb_555; |
rgb2scr = rgb_byte555; |
scr2rgb = byte555_rgb; |
pixelbytes = 2; |
break; |
case VISUAL_RGB_5_6_5: |
rgb_conv = rgb_565; |
rgb2scr = rgb_byte565; |
scr2rgb = byte565_rgb; |
pixelbytes = 2; |
break; |
case VISUAL_RGB_8_8_8: |
rgb_conv = rgb_888; |
rgb2scr = rgb_byte888; |
scr2rgb = byte888_rgb; |
pixelbytes = 3; |
break; |
case VISUAL_RGB_8_8_8_0: |
rgb_conv = rgb_888; |
rgb2scr = rgb_byte888; |
scr2rgb = byte888_rgb; |
pixelbytes = 4; |
break; |
case VISUAL_RGB_0_8_8_8: |
rgb_conv = rgb_0888; |
rgb2scr = rgb_byte0888; |
scr2rgb = byte0888_rgb; |
pixelbytes = 4; |
break; |
case VISUAL_BGR_0_8_8_8: |
rgb_conv = bgr_0888; |
rgb2scr = bgr_byte0888; |
scr2rgb = byte0888_bgr; |
pixelbytes = 4; |
break; |
default: |
459,67 → 505,58 |
panic("Unsupported visual.\n"); |
} |
unsigned int fbsize = props->scan * props->y + props->offset; |
/* Map the framebuffer */ |
fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize); |
fbaddress += props->offset; |
xres = props->x; |
yres = props->y; |
scanline = props->scan; |
cols = X2COL(xres); |
rows = Y2ROW(yres); |
if (yres > ylogo) { |
ylogo = LOGO_HEIGHT; |
rowtrim = rows - Y2ROW(ylogo); |
if (ylogo % FONT_SCANLINES > 0) |
rowtrim--; |
ytrim = ROW2Y(rowtrim); |
} else { |
ylogo = 0; |
ytrim = yres; |
rowtrim = rows; |
} |
glyphscanline = FONT_WIDTH * pixelbytes; |
glyphbytes = ROW2Y(glyphscanline); |
bgscanbytes = xres * pixelbytes; |
unsigned int fbsize = scanline * yres; |
unsigned int bbsize = cols * rows; |
unsigned int glyphsize = FONT_GLYPHS * glyphbytes; |
backbuf = (uint8_t *) malloc(bbsize, 0); |
if (!backbuf) |
panic("Unable to allocate backbuffer.\n"); |
glyphs = (uint8_t *) malloc(glyphsize, 0); |
if (!glyphs) |
panic("Unable to allocate glyphs.\n"); |
bgscan = malloc(bgscanbytes, 0); |
if (!bgscan) |
panic("Unable to allocate background pixel.\n"); |
memsetb(backbuf, bbsize, 0); |
glyphs_render(); |
fb_addr = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize); |
fb_parea.pbase = (uintptr_t) props->addr + props->offset; |
fb_parea.vbase = (uintptr_t) fb_addr; |
rows = props->y / FONT_SCANLINES; |
columns = props->x / COL_WIDTH; |
fb_parea.pbase = (uintptr_t) props->addr; |
fb_parea.vbase = (uintptr_t) fbaddress; |
fb_parea.frames = SIZE2FRAMES(fbsize); |
fb_parea.cacheable = false; |
ddi_parea_register(&fb_parea); |
sysinfo_set_item_val("fb", NULL, true); |
sysinfo_set_item_val("fb.kind", NULL, 1); |
sysinfo_set_item_val("fb.width", NULL, xres); |
sysinfo_set_item_val("fb.height", NULL, yres); |
sysinfo_set_item_val("fb.scanline", NULL, scanline); |
sysinfo_set_item_val("fb.scanline", NULL, props->scan); |
sysinfo_set_item_val("fb.visual", NULL, props->visual); |
sysinfo_set_item_val("fb.address.physical", NULL, props->addr); |
sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors); |
/* Allocate double buffer */ |
unsigned int order = fnzb(SIZE2FRAMES(fbsize) - 1) + 1; |
dbbuffer = (uint8_t *) frame_alloc(order, FRAME_ATOMIC | FRAME_KA); |
if (!dbbuffer) |
printf("Failed to allocate scroll buffer.\n"); |
dboffset = 0; |
/* Initialized blank line */ |
blankline = (uint8_t *) malloc(ROW_BYTES, FRAME_ATOMIC); |
if (!blankline) |
panic("Failed to allocate blank line for framebuffer."); |
unsigned int x, y; |
for (y = 0; y < FONT_SCANLINES; y++) |
for (x = 0; x < xres; x++) |
(*rgb2scr)(&blankline[POINTPOS(x, y)], COLOR(BGCOLOR)); |
fb_redraw(); |
clear_screen(); |
/* Update size of screen to match text area */ |
yres = rows * FONT_SCANLINES; |
draw_logo(xres - helenos_width, 0); |
invert_cursor(); |
chardev_initialize("fb", &framebuffer, &fb_ops); |
stdout = &framebuffer; |
} |
/branches/dynload/kernel/genarch/src/fb/font-8x16.c |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genarch |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
34,7 → 34,7 |
#include <genarch/fb/font-8x16.h> |
uint8_t fb_font[FONT_GLYPHS * FONT_SCANLINES] = { |
unsigned char fb_font[FONT_GLIPHS * FONT_SCANLINES] = { |
/* 0 0x00 '^@' */ |
0x00, /* 00000000 */ |
/branches/dynload/kernel/genarch/src/fb/helenos.xbm |
---|
0,0 → 1,163 |
#define helenos_width 127 |
#define helenos_height 120 |
static unsigned char helenos_bits[] = { |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x80, 0x0f, 0x78, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x80, 0x81, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, |
0x0f, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x06, |
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, |
0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x0c, |
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, |
0x00, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, |
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, |
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00, 0x00, |
0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, |
0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0xc0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x80, 0xc1, 0x00, 0x00, 0x00, |
0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x80, |
0xc1, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xfe, 0x01, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x83, 0x01, 0x00, 0x00, |
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, |
0x03, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xff, 0x07, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, |
0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, |
0x0c, 0x02, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xff, 0x0f, 0x00, 0x00, 0x0c, 0x06, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, |
0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, |
0x18, 0x0c, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, |
0xfc, 0x1f, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, |
0x80, 0x1f, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, |
0x18, 0x02, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, |
0x30, 0x18, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, |
0xf8, 0x3f, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, |
0xe0, 0x7f, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, |
0x38, 0x0c, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, |
0xe0, 0x20, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, |
0xf0, 0x7f, 0x00, 0x00, 0xc0, 0x78, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, |
0xe0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xc0, 0x7c, 0x00, 0x00, |
0x70, 0x18, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0xf0, 0xff, 0x00, 0x00, |
0x80, 0xfd, 0x00, 0x00, 0x60, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, |
0xfc, 0xff, 0x01, 0x00, 0x80, 0xf9, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, |
0xc0, 0xff, 0x01, 0x80, 0xff, 0xff, 0x01, 0x00, 0x80, 0xfb, 0x00, 0x00, |
0xc0, 0x7f, 0x00, 0x00, 0xc0, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x03, 0x00, |
0x00, 0xf3, 0x01, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x80, 0xff, 0x03, 0xfc, |
0xff, 0xff, 0x03, 0x00, 0x00, 0xf3, 0x01, 0x00, 0xc0, 0x7f, 0x00, 0x00, |
0x80, 0xff, 0x07, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf6, 0x03, 0x00, |
0x80, 0xff, 0x00, 0x00, 0x00, 0xff, 0xe7, 0xff, 0xff, 0xff, 0x07, 0x00, |
0x00, 0xe6, 0x03, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, |
0xff, 0xff, 0x07, 0x00, 0x00, 0xec, 0x07, 0x00, 0x00, 0xff, 0x01, 0x00, |
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xcc, 0x07, 0x00, |
0x00, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0x0f, 0x00, |
0x00, 0xdc, 0x07, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xfe, 0xff, 0xff, |
0x1f, 0xfe, 0x0f, 0x00, 0x00, 0xd8, 0x0f, 0x00, 0x00, 0xfe, 0x03, 0x00, |
0x00, 0xfc, 0xff, 0xff, 0x03, 0xfe, 0x1f, 0x00, 0x00, 0x98, 0x0f, 0x00, |
0x00, 0xfe, 0x03, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0xfc, 0x1f, 0x00, |
0x00, 0xb0, 0x1f, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x1f, |
0x00, 0xfc, 0x3f, 0x00, 0x00, 0x30, 0x1f, 0x00, 0x00, 0xfc, 0x07, 0x00, |
0x00, 0xf8, 0xff, 0x07, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x70, 0x1f, 0x00, |
0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0x7f, 0x00, |
0x00, 0x60, 0x3e, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x7f, 0x00, |
0x00, 0xf8, 0x7f, 0x00, 0x00, 0xe0, 0x3e, 0x00, 0x00, 0xf8, 0x0f, 0x00, |
0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xf8, 0x7e, 0x00, |
0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x00, |
0x00, 0xfc, 0x7c, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0x00, |
0x00, 0xf0, 0xff, 0x00, 0x00, 0xfe, 0xfd, 0x00, 0x00, 0xf0, 0x1f, 0x00, |
0x00, 0xe0, 0xff, 0x01, 0x00, 0xe0, 0xff, 0x00, 0x80, 0xff, 0xf9, 0x00, |
0x00, 0xe0, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, 0xe0, 0xff, 0x00, |
0xc0, 0xff, 0xfb, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0x03, |
0x00, 0xc0, 0x7f, 0x00, 0xe0, 0xff, 0xfb, 0x01, 0x00, 0xc0, 0x7f, 0x00, |
0x00, 0x80, 0xff, 0x03, 0x00, 0xc0, 0x7f, 0x00, 0xf8, 0xff, 0xf7, 0x01, |
0x00, 0xc0, 0x7f, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x80, 0x3f, 0x00, |
0xfc, 0xff, 0xf7, 0x03, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x80, 0xff, 0x07, |
0x00, 0x00, 0x00, 0x00, 0xfe, 0xef, 0xe7, 0x03, 0x00, 0x80, 0xff, 0x00, |
0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xdf, 0xef, 0x07, |
0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xc0, |
0xff, 0xdf, 0xef, 0x07, 0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xff, 0x0f, |
0x00, 0x00, 0x00, 0xe0, 0xff, 0xcf, 0xcf, 0x07, 0x00, 0x00, 0xff, 0x01, |
0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0xc3, 0xcf, 0x0f, |
0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xfc, |
0xff, 0xe0, 0xcf, 0x0f, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xfc, 0x1f, |
0x00, 0x00, 0x00, 0xfe, 0xff, 0xf9, 0xc7, 0x0f, 0x00, 0x00, 0xfe, 0x03, |
0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe7, 0x0f, |
0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0xff, |
0xff, 0xff, 0xe7, 0x0f, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xf8, 0x07, |
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xe3, 0x0f, 0x00, 0x00, 0xfc, 0x0f, |
0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xf1, 0x0f, |
0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, |
0xff, 0xff, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0xfc, 0x0f, 0x00, 0x00, 0xf0, 0x1f, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x07, 0xfe, 0x0f, |
0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, |
0xff, 0x81, 0xff, 0x07, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, |
0x00, 0xe0, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x3f, |
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0xfc, 0xff, 0x07, |
0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, |
0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, |
0x00, 0xfe, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0x7f, |
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x00, |
0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xc0, |
0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, |
0xe0, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xdf, |
0x00, 0x3c, 0x00, 0x00, 0xf0, 0xff, 0x03, 0xfe, 0xff, 0xff, 0x0f, 0x00, |
0x00, 0x00, 0x00, 0xcf, 0x00, 0x7e, 0x00, 0x00, 0xfc, 0x7f, 0xc0, 0xff, |
0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x01, 0x7e, 0x00, 0x00, |
0xfe, 0x0f, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, |
0x01, 0x3e, 0x00, 0x00, 0xff, 0x03, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x9e, 0x03, 0x00, 0x00, 0xc0, 0x7f, 0xc0, 0xff, 0xff, |
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x03, 0x00, 0x00, 0xe0, |
0x0f, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, |
0x03, 0x00, 0x00, 0xf8, 0x01, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x7c, 0x06, 0x00, 0x00, 0x3f, 0xe0, 0xff, 0xff, 0xff, |
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x0e, 0x00, 0xe0, 0x0f, |
0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, |
0x3c, 0x00, 0xfc, 0x01, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0xf8, 0x78, 0x80, 0x3f, 0xe0, 0xff, 0xff, 0xff, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe1, 0xff, 0x07, 0xfc, |
0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, |
0x81, 0xff, 0x80, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0xfe, 0xff, |
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, |
0x0f, 0x00, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0xc0, 0x3f, 0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, |
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, |
0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0xf0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
/branches/dynload/kernel/genarch/src/mm/asid.c |
---|
32,7 → 32,7 |
/** |
* @file |
* @brief ASID management. |
* @brief ASID management. |
* |
* Modern processor architectures optimize TLB utilization |
* by using ASIDs (a.k.a. memory contexts on sparc64 and |
/branches/dynload/kernel/genarch/src/acpi/acpi.c |
---|
49,12 → 49,8 |
struct acpi_rsdt *acpi_rsdt = NULL; |
struct acpi_xsdt *acpi_xsdt = NULL; |
struct acpi_signature_map signature_map[] = { |
{ |
(uint8_t *) "APIC", |
(void *) &acpi_madt, |
"Multiple APIC Description Table" |
} |
struct acpi_signature_map signature_map[] = { |
{ (uint8_t *)"APIC", (void *) &acpi_madt, "Multiple APIC Description Table" } |
}; |
static int rsdp_check(uint8_t *rsdp) { |
109,7 → 105,7 |
if (!acpi_sdt_check((uint8_t *) h)) |
goto next; |
*signature_map[j].sdt_ptr = h; |
LOG("%p: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description); |
printf("%p: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description); |
} |
} |
next: |
130,7 → 126,7 |
if (!acpi_sdt_check((uint8_t *) h)) |
goto next; |
*signature_map[j].sdt_ptr = h; |
LOG("%p: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description); |
printf("%p: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description); |
} |
} |
next: |
164,7 → 160,7 |
return; |
rsdp_found: |
LOG("%p: ACPI Root System Description Pointer\n", acpi_rsdp); |
printf("%p: ACPI Root System Description Pointer\n", acpi_rsdp); |
acpi_rsdt = (struct acpi_rsdt *) (unative_t) acpi_rsdp->rsdt_address; |
if (acpi_rsdp->revision) acpi_xsdt = (struct acpi_xsdt *) ((uintptr_t) acpi_rsdp->xsdt_address); |
/branches/dynload/kernel/genarch/Makefile.inc |
---|
60,7 → 60,6 |
ifeq ($(CONFIG_FB),y) |
GENARCH_SOURCES += \ |
genarch/src/fb/font-8x16.c \ |
genarch/src/fb/logo-196x66.c \ |
genarch/src/fb/fb.c |
DEFS += -DCONFIG_FB |
endif |
/branches/dynload/kernel/Makefile |
---|
90,14 → 90,10 |
DEFS += -DCONFIG_DEBUG |
endif |
ifeq ($(CONFIG_LOG),y) |
DEFS += -DCONFIG_LOG |
ifeq ($(CONFIG_EDEBUG),y) |
DEFS += -DCONFIG_EDEBUG |
endif |
ifeq ($(CONFIG_KCONSOLE),y) |
DEFS += -DCONFIG_KCONSOLE |
endif |
ifeq ($(CONFIG_DEBUG_SPINLOCK),y) |
DEFS += -DCONFIG_DEBUG_SPINLOCK |
endif |
240,6 → 236,8 |
generic/src/adt/list.c \ |
generic/src/console/chardev.c \ |
generic/src/console/console.c \ |
generic/src/console/kconsole.c \ |
generic/src/console/cmd.c \ |
generic/src/cpu/cpu.c \ |
generic/src/ddi/ddi.c \ |
generic/src/ddi/irq.c \ |
301,15 → 299,6 |
generic/src/security/cap.c \ |
generic/src/sysinfo/sysinfo.c |
## Kernel console support |
# |
ifeq ($(CONFIG_KCONSOLE),y) |
GENERIC_SOURCES += \ |
generic/src/console/kconsole.c \ |
generic/src/console/cmd.c |
endif |
## Udebug interface sources |
# |
/branches/dynload/kernel/arch/sparc64/include/drivers/scr.h |
---|
49,7 → 49,6 |
extern scr_type_t scr_type; |
extern void scr_init(ofw_tree_node_t *node); |
extern void scr_redraw(void); |
#endif |
/branches/dynload/kernel/arch/sparc64/include/barrier.h |
---|
82,8 → 82,6 |
asm volatile ("membar #Sync\n"); |
} |
#if defined (US) |
#define smc_coherence(a) \ |
{ \ |
write_barrier(); \ |
99,22 → 97,6 |
flush((void *)(a) + i); \ |
} |
#elif defined (US3) |
#define smc_coherence(a) \ |
{ \ |
write_barrier(); \ |
flush_pipeline(); \ |
} |
#define smc_coherence_block(a, l) \ |
{ \ |
write_barrier(); \ |
flush_pipeline(); \ |
} |
#endif /* defined(US3) */ |
#endif |
/** @} |
/branches/dynload/kernel/arch/sparc64/src/console.c |
---|
175,7 → 175,6 |
*/ |
void arch_grab_console(void) |
{ |
scr_redraw(); |
switch (kbd_type) { |
#ifdef CONFIG_Z8530 |
case KBD_Z8530: |
/branches/dynload/kernel/arch/sparc64/src/drivers/kbd.c |
---|
86,20 → 86,21 |
*/ |
uint32_t interrupts; |
prop = ofw_tree_getprop(node, "interrupts"); |
if ((!prop) || (!prop->value)) |
if (!prop || !prop->value) |
panic("Can't find \"interrupts\" property.\n"); |
interrupts = *((uint32_t *) prop->value); |
/* |
* Read 'reg' property. |
*/ |
prop = ofw_tree_getprop(node, "reg"); |
if ((!prop) || (!prop->value)) |
if (!prop || !prop->value) |
panic("Can't find \"reg\" property.\n"); |
uintptr_t pa; |
size_t size; |
inr_t inr; |
devno_t devno = device_assign_devno(); |
switch (kbd_type) { |
case KBD_Z8530: |
131,9 → 132,9 |
return; |
}; |
break; |
default: |
panic("Unexpected keyboard type.\n"); |
panic("Unexpected type.\n"); |
} |
/* |
144,18 → 145,17 |
*/ |
aligned_addr = ALIGN_DOWN(pa, PAGE_SIZE); |
offset = pa - aligned_addr; |
uintptr_t vaddr = hw_map(aligned_addr, offset + size) + offset; |
switch (kbd_type) { |
#ifdef CONFIG_Z8530 |
case KBD_Z8530: |
z8530_init(device_assign_devno(), |
hw_map(aligned_addr, offset + size) + offset, inr, cir, cir_arg); |
z8530_init(devno, vaddr, inr, cir, cir_arg); |
break; |
#endif |
#ifdef CONFIG_NS16550 |
case KBD_NS16550: |
ns16550_init(device_assign_devno(), |
(ioport_t) (hw_map(aligned_addr, offset + size) + offset), inr, cir, cir_arg); |
ns16550_init(devno, (ioport_t)vaddr, inr, cir, cir_arg); |
break; |
#endif |
default: |
/branches/dynload/kernel/arch/sparc64/src/drivers/scr.c |
---|
78,7 → 78,6 |
} |
uintptr_t fb_addr; |
unsigned int fb_offset = 0; |
uint32_t fb_width = 0; |
uint32_t fb_height = 0; |
uint32_t fb_depth = 0; |
168,12 → 167,10 |
return; |
} |
fb_offset = 4 * 0x2000; |
switch (fb_depth) { |
case 8: |
fb_scanline = fb_linebytes * (fb_depth >> 3); |
visual = VISUAL_INDIRECT_8; |
visual = VISUAL_SB1500_PALETTE; |
break; |
case 16: |
fb_scanline = fb_linebytes * (fb_depth >> 3); |
228,7 → 225,7 |
fb_properties_t props = { |
.addr = fb_addr, |
.offset = fb_offset, |
.offset = 0, |
.x = fb_width, |
.y = fb_height, |
.scan = fb_scanline, |
237,10 → 234,5 |
fb_init(&props); |
} |
void scr_redraw(void) |
{ |
fb_redraw(); |
} |
/** @} |
*/ |
/branches/dynload/kernel/arch/ia64/src/ski/ski.c |
---|
229,8 → 229,6 |
sysinfo_set_item_val("kbd.inr", NULL, SKI_KBD_INR); |
sysinfo_set_item_val("kbd.devno", NULL, ski_kbd_devno); |
sysinfo_set_item_val("kbd.type", NULL, KBD_SKI); |
sysinfo_set_item_val("fb", NULL, false); |
} |
void ski_kbd_grab(void) |
/branches/dynload/kernel/arch/arm32/src/mm/tlb.c |
---|
81,7 → 81,7 |
* @param page Address of the first page whose entry is to be invalidated. |
* @param cnt Number of entries to invalidate. |
*/ |
void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, count_t cnt) |
void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt) |
{ |
unsigned int i; |
/branches/dynload/kernel/arch/ppc32/src/ppc32.c |
---|
152,7 → 152,6 |
*/ |
void arch_grab_console(void) |
{ |
fb_redraw(); |
cuda_grab(); |
} |
/branches/dynload/kernel/arch/mips32/src/console.c |
---|
36,7 → 36,6 |
#include <arch/console.h> |
#include <arch/drivers/serial.h> |
#include <arch/drivers/msim.h> |
#include <genarch/fb/fb.h> |
void console_init(devno_t devno) |
{ |
51,9 → 50,6 |
*/ |
void arch_grab_console(void) |
{ |
#ifdef CONFIG_FB |
fb_redraw(); |
#endif |
msim_kbd_grab(); |
} |
/branches/dynload/kernel/arch/mips32/src/debugger.c |
---|
47,8 → 47,6 |
bpinfo_t breakpoints[BKPOINTS_MAX]; |
SPINLOCK_INITIALIZE(bkpoint_lock); |
#ifdef CONFIG_KCONSOLE |
static int cmd_print_breakpoints(cmd_arg_t *argv); |
static cmd_info_t bkpts_info = { |
.name = "bkpts", |
125,12 → 123,10 |
{0, 0} /* EndOfTable */ |
}; |
/** Test, if the given instruction is a jump or branch instruction |
* |
* @param instr Instruction code |
* @return true - it is jump instruction, false otherwise |
* |
*/ |
static bool is_jump(unative_t instr) |
{ |
271,8 → 267,6 |
return 1; |
} |
#endif |
/** Initialize debugger */ |
void debugger_init() |
{ |
280,24 → 274,22 |
for (i = 0; i < BKPOINTS_MAX; i++) |
breakpoints[i].address = NULL; |
#ifdef CONFIG_KCONSOLE |
cmd_initialize(&bkpts_info); |
if (!cmd_register(&bkpts_info)) |
printf("Cannot register command %s\n", bkpts_info.name); |
panic("could not register command %s\n", bkpts_info.name); |
cmd_initialize(&delbkpt_info); |
if (!cmd_register(&delbkpt_info)) |
printf("Cannot register command %s\n", delbkpt_info.name); |
panic("could not register command %s\n", delbkpt_info.name); |
cmd_initialize(&addbkpt_info); |
if (!cmd_register(&addbkpt_info)) |
printf("Cannot register command %s\n", addbkpt_info.name); |
panic("could not register command %s\n", addbkpt_info.name); |
cmd_initialize(&addbkpte_info); |
if (!cmd_register(&addbkpte_info)) |
printf("Cannot register command %s\n", addbkpte_info.name); |
#endif |
panic("could not register command %s\n", addbkpte_info.name); |
} |
/** Handle breakpoint |
375,20 → 367,19 |
if (cur->bkfunc) |
cur->bkfunc(cur, istate); |
} else { |
#ifdef CONFIG_KCONSOLE |
printf("***Type 'exit' to exit kconsole.\n"); |
/* This disables all other processors - we are not SMP, |
* actually this gets us to cpu_halt, if scheduler() is run |
* - we generally do not want scheduler to be run from debug, |
* so this is a good idea |
*/ |
atomic_set(&haltstate, 1); |
atomic_set(&haltstate,1); |
spinlock_unlock(&bkpoint_lock); |
kconsole("debug", "Debug console ready (type 'exit' to continue)\n", false); |
kconsole("debug"); |
spinlock_lock(&bkpoint_lock); |
atomic_set(&haltstate, 0); |
#endif |
atomic_set(&haltstate,0); |
} |
if (cur && cur->address == fireaddr && (cur->flags & BKPOINT_INPROG)) { |
/* Remove one-shot breakpoint */ |
/branches/dynload/kernel/arch/mips32/src/exception.c |
---|
45,6 → 45,7 |
#include <print.h> |
#include <interrupt.h> |
#include <func.h> |
#include <console/kconsole.h> |
#include <ddi/irq.h> |
#include <arch/debugger.h> |
/branches/dynload/kernel/arch/mips32/src/cpu/cpu.c |
---|
48,7 → 48,7 |
{ "MIPS", "R2000" }, /* 0x01 */ |
{ "MIPS", "R3000" }, /* 0x02 */ |
{ "MIPS", "R6000" }, /* 0x03 */ |
{ "MIPS", "R4000/R4400" }, /* 0x04 */ |
{ "MIPS", " R4000/R4400" }, /* 0x04 */ |
{ "LSI Logic", "R3000" }, /* 0x05 */ |
{ "MIPS", "R6000A" }, /* 0x06 */ |
{ "IDT", "3051/3052" }, /* 0x07 */ |
123,9 → 123,9 |
data = &imp_data[m->arch.imp_num]; |
} |
printf("cpu%u: %s %s (rev=%d.%d, imp=%d)\n", |
printf("cpu%d: %s %s (rev=%d.%d, imp=%d)\n", |
m->id, data->vendor, data->model, m->arch.rev_num >> 4, |
m->arch.rev_num & 0x0f, m->arch.imp_num); |
m->arch.rev_num & 0xf, m->arch.imp_num); |
} |
/** @} |
/branches/dynload/kernel/arch/mips32/include/mm/asid.h |
---|
37,7 → 37,7 |
#include <arch/types.h> |
#define ASID_MAX_ARCH 255 /* 2^8 - 1 */ |
#define ASID_MAX_ARCH 255 /* 2^8 - 1 */ |
typedef uint8_t asid_t; |
/branches/dynload/kernel/arch/ia32/src/drivers/vesa.c |
---|
97,11 → 97,6 |
fb_init(&vesa_props); |
} |
void vesa_redraw(void) |
{ |
fb_redraw(); |
} |
#endif |
/** @} |
/branches/dynload/kernel/arch/ia32/src/cpu/cpu.c |
---|
65,8 → 65,8 |
static char *vendor_str[] = { |
"Unknown Vendor", |
"AMD", |
"Intel" |
"AuthenticAMD", |
"GenuineIntel" |
}; |
void fpu_disable(void) |
77,7 → 77,7 |
"mov %%eax,%%cr0;" |
: |
: |
: "%eax" |
:"%eax" |
); |
} |
89,7 → 89,7 |
"mov %%eax,%%cr0;" |
: |
: |
: "%eax" |
:"%eax" |
); |
} |
140,31 → 140,29 |
/* |
* Check for AMD processor. |
*/ |
if ((info.cpuid_ebx == AMD_CPUID_EBX) |
&& (info.cpuid_ecx == AMD_CPUID_ECX) |
&& (info.cpuid_edx == AMD_CPUID_EDX)) |
if (info.cpuid_ebx==AMD_CPUID_EBX && info.cpuid_ecx==AMD_CPUID_ECX && info.cpuid_edx==AMD_CPUID_EDX) { |
CPU->arch.vendor = VendorAMD; |
} |
/* |
* Check for Intel processor. |
*/ |
if ((info.cpuid_ebx == INTEL_CPUID_EBX) |
&& (info.cpuid_ecx == INTEL_CPUID_ECX) |
&& (info.cpuid_edx == INTEL_CPUID_EDX)) |
if (info.cpuid_ebx==INTEL_CPUID_EBX && info.cpuid_ecx==INTEL_CPUID_ECX && info.cpuid_edx==INTEL_CPUID_EDX) { |
CPU->arch.vendor = VendorIntel; |
} |
cpuid(1, &info); |
CPU->arch.family = (info.cpuid_eax >> 8) & 0x0f; |
CPU->arch.model = (info.cpuid_eax >> 4) & 0x0f; |
CPU->arch.stepping = (info.cpuid_eax >> 0) & 0x0f; |
CPU->arch.family = (info.cpuid_eax>>8)&0xf; |
CPU->arch.model = (info.cpuid_eax>>4)&0xf; |
CPU->arch.stepping = (info.cpuid_eax>>0)&0xf; |
} |
} |
void cpu_print_report(cpu_t* cpu) |
void cpu_print_report(cpu_t* m) |
{ |
printf("cpu%u: (%s family=%u model=%u stepping=%u) %" PRIu16 " MHz\n", |
cpu->id, vendor_str[cpu->arch.vendor], cpu->arch.family, |
cpu->arch.model, cpu->arch.stepping, cpu->frequency_mhz); |
printf("cpu%d: (%s family=%d model=%d stepping=%d) %dMHz\n", |
m->id, vendor_str[m->arch.vendor], m->arch.family, m->arch.model, m->arch.stepping, |
m->frequency_mhz); |
} |
/** @} |
/branches/dynload/kernel/arch/ia32/src/boot/vga323.pal |
---|
1,256 → 1,256 |
.byte 0x00, 0x00, 0x00, 0x00 |
.byte 0x09, 0x00, 0x00, 0x00 |
.byte 0x12, 0x00, 0x00, 0x00 |
.byte 0x1b, 0x00, 0x00, 0x00 |
.byte 0x24, 0x00, 0x00, 0x00 |
.byte 0x2d, 0x00, 0x00, 0x00 |
.byte 0x36, 0x00, 0x00, 0x00 |
.byte 0x3f, 0x00, 0x00, 0x00 |
.byte 0x00, 0x15, 0x00, 0x00 |
.byte 0x09, 0x15, 0x00, 0x00 |
.byte 0x12, 0x15, 0x00, 0x00 |
.byte 0x1b, 0x15, 0x00, 0x00 |
.byte 0x24, 0x15, 0x00, 0x00 |
.byte 0x2d, 0x15, 0x00, 0x00 |
.byte 0x36, 0x15, 0x00, 0x00 |
.byte 0x3f, 0x15, 0x00, 0x00 |
.byte 0x00, 0x2a, 0x00, 0x00 |
.byte 0x09, 0x2a, 0x00, 0x00 |
.byte 0x12, 0x2a, 0x00, 0x00 |
.byte 0x1b, 0x2a, 0x00, 0x00 |
.byte 0x24, 0x2a, 0x00, 0x00 |
.byte 0x2d, 0x2a, 0x00, 0x00 |
.byte 0x36, 0x2a, 0x00, 0x00 |
.byte 0x3f, 0x2a, 0x00, 0x00 |
.byte 0x00, 0x3f, 0x00, 0x00 |
.byte 0x09, 0x3f, 0x00, 0x00 |
.byte 0x12, 0x3f, 0x00, 0x00 |
.byte 0x1b, 0x3f, 0x00, 0x00 |
.byte 0x24, 0x3f, 0x00, 0x00 |
.byte 0x2d, 0x3f, 0x00, 0x00 |
.byte 0x36, 0x3f, 0x00, 0x00 |
.byte 0x3f, 0x3f, 0x00, 0x00 |
.byte 0x00, 0x00, 0x09, 0x00 |
.byte 0x09, 0x00, 0x09, 0x00 |
.byte 0x12, 0x00, 0x09, 0x00 |
.byte 0x1b, 0x00, 0x09, 0x00 |
.byte 0x24, 0x00, 0x09, 0x00 |
.byte 0x2d, 0x00, 0x09, 0x00 |
.byte 0x36, 0x00, 0x09, 0x00 |
.byte 0x3f, 0x00, 0x09, 0x00 |
.byte 0x00, 0x15, 0x09, 0x00 |
.byte 0x09, 0x15, 0x09, 0x00 |
.byte 0x12, 0x15, 0x09, 0x00 |
.byte 0x1b, 0x15, 0x09, 0x00 |
.byte 0x24, 0x15, 0x09, 0x00 |
.byte 0x2d, 0x15, 0x09, 0x00 |
.byte 0x36, 0x15, 0x09, 0x00 |
.byte 0x3f, 0x15, 0x09, 0x00 |
.byte 0x00, 0x2a, 0x09, 0x00 |
.byte 0x09, 0x2a, 0x09, 0x00 |
.byte 0x12, 0x2a, 0x09, 0x00 |
.byte 0x1b, 0x2a, 0x09, 0x00 |
.byte 0x24, 0x2a, 0x09, 0x00 |
.byte 0x2d, 0x2a, 0x09, 0x00 |
.byte 0x36, 0x2a, 0x09, 0x00 |
.byte 0x3f, 0x2a, 0x09, 0x00 |
.byte 0x00, 0x3f, 0x09, 0x00 |
.byte 0x09, 0x3f, 0x09, 0x00 |
.byte 0x12, 0x3f, 0x09, 0x00 |
.byte 0x1b, 0x3f, 0x09, 0x00 |
.byte 0x24, 0x3f, 0x09, 0x00 |
.byte 0x2d, 0x3f, 0x09, 0x00 |
.byte 0x36, 0x3f, 0x09, 0x00 |
.byte 0x3f, 0x3f, 0x09, 0x00 |
.byte 0x00, 0x00, 0x12, 0x00 |
.byte 0x09, 0x00, 0x12, 0x00 |
.byte 0x12, 0x00, 0x12, 0x00 |
.byte 0x1b, 0x00, 0x12, 0x00 |
.byte 0x24, 0x00, 0x12, 0x00 |
.byte 0x2d, 0x00, 0x12, 0x00 |
.byte 0x36, 0x00, 0x12, 0x00 |
.byte 0x3f, 0x00, 0x12, 0x00 |
.byte 0x00, 0x15, 0x12, 0x00 |
.byte 0x09, 0x15, 0x12, 0x00 |
.byte 0x12, 0x15, 0x12, 0x00 |
.byte 0x1b, 0x15, 0x12, 0x00 |
.byte 0x24, 0x15, 0x12, 0x00 |
.byte 0x2d, 0x15, 0x12, 0x00 |
.byte 0x36, 0x15, 0x12, 0x00 |
.byte 0x3f, 0x15, 0x12, 0x00 |
.byte 0x00, 0x2a, 0x12, 0x00 |
.byte 0x09, 0x2a, 0x12, 0x00 |
.byte 0x12, 0x2a, 0x12, 0x00 |
.byte 0x1b, 0x2a, 0x12, 0x00 |
.byte 0x24, 0x2a, 0x12, 0x00 |
.byte 0x2d, 0x2a, 0x12, 0x00 |
.byte 0x36, 0x2a, 0x12, 0x00 |
.byte 0x3f, 0x2a, 0x12, 0x00 |
.byte 0x00, 0x3f, 0x12, 0x00 |
.byte 0x09, 0x3f, 0x12, 0x00 |
.byte 0x12, 0x3f, 0x12, 0x00 |
.byte 0x1b, 0x3f, 0x12, 0x00 |
.byte 0x24, 0x3f, 0x12, 0x00 |
.byte 0x2d, 0x3f, 0x12, 0x00 |
.byte 0x36, 0x3f, 0x12, 0x00 |
.byte 0x3f, 0x3f, 0x12, 0x00 |
.byte 0x00, 0x00, 0x1b, 0x00 |
.byte 0x09, 0x00, 0x1b, 0x00 |
.byte 0x12, 0x00, 0x1b, 0x00 |
.byte 0x1b, 0x00, 0x1b, 0x00 |
.byte 0x24, 0x00, 0x1b, 0x00 |
.byte 0x2d, 0x00, 0x1b, 0x00 |
.byte 0x36, 0x00, 0x1b, 0x00 |
.byte 0x3f, 0x00, 0x1b, 0x00 |
.byte 0x00, 0x15, 0x1b, 0x00 |
.byte 0x09, 0x15, 0x1b, 0x00 |
.byte 0x12, 0x15, 0x1b, 0x00 |
.byte 0x1b, 0x15, 0x1b, 0x00 |
.byte 0x24, 0x15, 0x1b, 0x00 |
.byte 0x2d, 0x15, 0x1b, 0x00 |
.byte 0x36, 0x15, 0x1b, 0x00 |
.byte 0x3f, 0x15, 0x1b, 0x00 |
.byte 0x00, 0x2a, 0x1b, 0x00 |
.byte 0x09, 0x2a, 0x1b, 0x00 |
.byte 0x12, 0x2a, 0x1b, 0x00 |
.byte 0x1b, 0x2a, 0x1b, 0x00 |
.byte 0x24, 0x2a, 0x1b, 0x00 |
.byte 0x2d, 0x2a, 0x1b, 0x00 |
.byte 0x36, 0x2a, 0x1b, 0x00 |
.byte 0x3f, 0x2a, 0x1b, 0x00 |
.byte 0x00, 0x3f, 0x1b, 0x00 |
.byte 0x09, 0x3f, 0x1b, 0x00 |
.byte 0x12, 0x3f, 0x1b, 0x00 |
.byte 0x1b, 0x3f, 0x1b, 0x00 |
.byte 0x24, 0x3f, 0x1b, 0x00 |
.byte 0x2d, 0x3f, 0x1b, 0x00 |
.byte 0x36, 0x3f, 0x1b, 0x00 |
.byte 0x3f, 0x3f, 0x1b, 0x00 |
.byte 0x00, 0x00, 0x24, 0x00 |
.byte 0x09, 0x00, 0x24, 0x00 |
.byte 0x12, 0x00, 0x24, 0x00 |
.byte 0x1b, 0x00, 0x24, 0x00 |
.byte 0x24, 0x00, 0x24, 0x00 |
.byte 0x2d, 0x00, 0x24, 0x00 |
.byte 0x36, 0x00, 0x24, 0x00 |
.byte 0x3f, 0x00, 0x24, 0x00 |
.byte 0x00, 0x15, 0x24, 0x00 |
.byte 0x09, 0x15, 0x24, 0x00 |
.byte 0x12, 0x15, 0x24, 0x00 |
.byte 0x1b, 0x15, 0x24, 0x00 |
.byte 0x24, 0x15, 0x24, 0x00 |
.byte 0x2d, 0x15, 0x24, 0x00 |
.byte 0x36, 0x15, 0x24, 0x00 |
.byte 0x3f, 0x15, 0x24, 0x00 |
.byte 0x00, 0x2a, 0x24, 0x00 |
.byte 0x09, 0x2a, 0x24, 0x00 |
.byte 0x12, 0x2a, 0x24, 0x00 |
.byte 0x1b, 0x2a, 0x24, 0x00 |
.byte 0x24, 0x2a, 0x24, 0x00 |
.byte 0x2d, 0x2a, 0x24, 0x00 |
.byte 0x36, 0x2a, 0x24, 0x00 |
.byte 0x3f, 0x2a, 0x24, 0x00 |
.byte 0x00, 0x3f, 0x24, 0x00 |
.byte 0x09, 0x3f, 0x24, 0x00 |
.byte 0x12, 0x3f, 0x24, 0x00 |
.byte 0x1b, 0x3f, 0x24, 0x00 |
.byte 0x24, 0x3f, 0x24, 0x00 |
.byte 0x2d, 0x3f, 0x24, 0x00 |
.byte 0x36, 0x3f, 0x24, 0x00 |
.byte 0x3f, 0x3f, 0x24, 0x00 |
.byte 0x00, 0x00, 0x2d, 0x00 |
.byte 0x09, 0x00, 0x2d, 0x00 |
.byte 0x12, 0x00, 0x2d, 0x00 |
.byte 0x1b, 0x00, 0x2d, 0x00 |
.byte 0x24, 0x00, 0x2d, 0x00 |
.byte 0x2d, 0x00, 0x2d, 0x00 |
.byte 0x36, 0x00, 0x2d, 0x00 |
.byte 0x3f, 0x00, 0x2d, 0x00 |
.byte 0x00, 0x15, 0x2d, 0x00 |
.byte 0x09, 0x15, 0x2d, 0x00 |
.byte 0x12, 0x15, 0x2d, 0x00 |
.byte 0x1b, 0x15, 0x2d, 0x00 |
.byte 0x24, 0x15, 0x2d, 0x00 |
.byte 0x2d, 0x15, 0x2d, 0x00 |
.byte 0x36, 0x15, 0x2d, 0x00 |
.byte 0x3f, 0x15, 0x2d, 0x00 |
.byte 0x00, 0x2a, 0x2d, 0x00 |
.byte 0x09, 0x2a, 0x2d, 0x00 |
.byte 0x12, 0x2a, 0x2d, 0x00 |
.byte 0x1b, 0x2a, 0x2d, 0x00 |
.byte 0x24, 0x2a, 0x2d, 0x00 |
.byte 0x2d, 0x2a, 0x2d, 0x00 |
.byte 0x36, 0x2a, 0x2d, 0x00 |
.byte 0x3f, 0x2a, 0x2d, 0x00 |
.byte 0x00, 0x3f, 0x2d, 0x00 |
.byte 0x09, 0x3f, 0x2d, 0x00 |
.byte 0x12, 0x3f, 0x2d, 0x00 |
.byte 0x1b, 0x3f, 0x2d, 0x00 |
.byte 0x24, 0x3f, 0x2d, 0x00 |
.byte 0x2d, 0x3f, 0x2d, 0x00 |
.byte 0x36, 0x3f, 0x2d, 0x00 |
.byte 0x3f, 0x3f, 0x2d, 0x00 |
.byte 0x00, 0x00, 0x36, 0x00 |
.byte 0x09, 0x00, 0x36, 0x00 |
.byte 0x12, 0x00, 0x36, 0x00 |
.byte 0x1b, 0x00, 0x36, 0x00 |
.byte 0x24, 0x00, 0x36, 0x00 |
.byte 0x2d, 0x00, 0x36, 0x00 |
.byte 0x36, 0x00, 0x36, 0x00 |
.byte 0x3f, 0x00, 0x36, 0x00 |
.byte 0x00, 0x15, 0x36, 0x00 |
.byte 0x09, 0x15, 0x36, 0x00 |
.byte 0x12, 0x15, 0x36, 0x00 |
.byte 0x1b, 0x15, 0x36, 0x00 |
.byte 0x24, 0x15, 0x36, 0x00 |
.byte 0x2d, 0x15, 0x36, 0x00 |
.byte 0x36, 0x15, 0x36, 0x00 |
.byte 0x3f, 0x15, 0x36, 0x00 |
.byte 0x00, 0x2a, 0x36, 0x00 |
.byte 0x09, 0x2a, 0x36, 0x00 |
.byte 0x12, 0x2a, 0x36, 0x00 |
.byte 0x1b, 0x2a, 0x36, 0x00 |
.byte 0x24, 0x2a, 0x36, 0x00 |
.byte 0x2d, 0x2a, 0x36, 0x00 |
.byte 0x36, 0x2a, 0x36, 0x00 |
.byte 0x3f, 0x2a, 0x36, 0x00 |
.byte 0x00, 0x3f, 0x36, 0x00 |
.byte 0x09, 0x3f, 0x36, 0x00 |
.byte 0x12, 0x3f, 0x36, 0x00 |
.byte 0x1b, 0x3f, 0x36, 0x00 |
.byte 0x24, 0x3f, 0x36, 0x00 |
.byte 0x2d, 0x3f, 0x36, 0x00 |
.byte 0x36, 0x3f, 0x36, 0x00 |
.byte 0x3f, 0x3f, 0x36, 0x00 |
.byte 0x00, 0x00, 0x3f, 0x00 |
.byte 0x09, 0x00, 0x3f, 0x00 |
.byte 0x12, 0x00, 0x3f, 0x00 |
.byte 0x1b, 0x00, 0x3f, 0x00 |
.byte 0x24, 0x00, 0x3f, 0x00 |
.byte 0x2d, 0x00, 0x3f, 0x00 |
.byte 0x36, 0x00, 0x3f, 0x00 |
.byte 0x3f, 0x00, 0x3f, 0x00 |
.byte 0x00, 0x15, 0x3f, 0x00 |
.byte 0x09, 0x15, 0x3f, 0x00 |
.byte 0x12, 0x15, 0x3f, 0x00 |
.byte 0x1b, 0x15, 0x3f, 0x00 |
.byte 0x24, 0x15, 0x3f, 0x00 |
.byte 0x2d, 0x15, 0x3f, 0x00 |
.byte 0x36, 0x15, 0x3f, 0x00 |
.byte 0x3f, 0x15, 0x3f, 0x00 |
.byte 0x00, 0x2a, 0x3f, 0x00 |
.byte 0x09, 0x2a, 0x3f, 0x00 |
.byte 0x12, 0x2a, 0x3f, 0x00 |
.byte 0x1b, 0x2a, 0x3f, 0x00 |
.byte 0x24, 0x2a, 0x3f, 0x00 |
.byte 0x2d, 0x2a, 0x3f, 0x00 |
.byte 0x36, 0x2a, 0x3f, 0x00 |
.byte 0x3f, 0x2a, 0x3f, 0x00 |
.byte 0x00, 0x3f, 0x3f, 0x00 |
.byte 0x09, 0x3f, 0x3f, 0x00 |
.byte 0x12, 0x3f, 0x3f, 0x00 |
.byte 0x1b, 0x3f, 0x3f, 0x00 |
.byte 0x24, 0x3f, 0x3f, 0x00 |
.byte 0x2d, 0x3f, 0x3f, 0x00 |
.byte 0x36, 0x3f, 0x3f, 0x00 |
.byte 0x3f, 0x3f, 0x3f, 0x00 |
.byte 0x36, 0x3f, 0x3f, 0x00 |
.byte 0x2d, 0x3f, 0x3f, 0x00 |
.byte 0x24, 0x3f, 0x3f, 0x00 |
.byte 0x1b, 0x3f, 0x3f, 0x00 |
.byte 0x12, 0x3f, 0x3f, 0x00 |
.byte 0x09, 0x3f, 0x3f, 0x00 |
.byte 0x00, 0x3f, 0x3f, 0x00 |
.byte 0x3f, 0x2a, 0x3f, 0x00 |
.byte 0x36, 0x2a, 0x3f, 0x00 |
.byte 0x2d, 0x2a, 0x3f, 0x00 |
.byte 0x24, 0x2a, 0x3f, 0x00 |
.byte 0x1b, 0x2a, 0x3f, 0x00 |
.byte 0x12, 0x2a, 0x3f, 0x00 |
.byte 0x09, 0x2a, 0x3f, 0x00 |
.byte 0x00, 0x2a, 0x3f, 0x00 |
.byte 0x3f, 0x15, 0x3f, 0x00 |
.byte 0x36, 0x15, 0x3f, 0x00 |
.byte 0x2d, 0x15, 0x3f, 0x00 |
.byte 0x24, 0x15, 0x3f, 0x00 |
.byte 0x1b, 0x15, 0x3f, 0x00 |
.byte 0x12, 0x15, 0x3f, 0x00 |
.byte 0x09, 0x15, 0x3f, 0x00 |
.byte 0x00, 0x15, 0x3f, 0x00 |
.byte 0x3f, 0x00, 0x3f, 0x00 |
.byte 0x36, 0x00, 0x3f, 0x00 |
.byte 0x2d, 0x00, 0x3f, 0x00 |
.byte 0x24, 0x00, 0x3f, 0x00 |
.byte 0x1b, 0x00, 0x3f, 0x00 |
.byte 0x12, 0x00, 0x3f, 0x00 |
.byte 0x09, 0x00, 0x3f, 0x00 |
.byte 0x00, 0x00, 0x3f, 0x00 |
.byte 0x3f, 0x3f, 0x36, 0x00 |
.byte 0x36, 0x3f, 0x36, 0x00 |
.byte 0x2d, 0x3f, 0x36, 0x00 |
.byte 0x24, 0x3f, 0x36, 0x00 |
.byte 0x1b, 0x3f, 0x36, 0x00 |
.byte 0x12, 0x3f, 0x36, 0x00 |
.byte 0x09, 0x3f, 0x36, 0x00 |
.byte 0x00, 0x3f, 0x36, 0x00 |
.byte 0x3f, 0x2a, 0x36, 0x00 |
.byte 0x36, 0x2a, 0x36, 0x00 |
.byte 0x2d, 0x2a, 0x36, 0x00 |
.byte 0x24, 0x2a, 0x36, 0x00 |
.byte 0x1b, 0x2a, 0x36, 0x00 |
.byte 0x12, 0x2a, 0x36, 0x00 |
.byte 0x09, 0x2a, 0x36, 0x00 |
.byte 0x00, 0x2a, 0x36, 0x00 |
.byte 0x3f, 0x15, 0x36, 0x00 |
.byte 0x36, 0x15, 0x36, 0x00 |
.byte 0x2d, 0x15, 0x36, 0x00 |
.byte 0x24, 0x15, 0x36, 0x00 |
.byte 0x1b, 0x15, 0x36, 0x00 |
.byte 0x12, 0x15, 0x36, 0x00 |
.byte 0x09, 0x15, 0x36, 0x00 |
.byte 0x00, 0x15, 0x36, 0x00 |
.byte 0x3f, 0x00, 0x36, 0x00 |
.byte 0x36, 0x00, 0x36, 0x00 |
.byte 0x2d, 0x00, 0x36, 0x00 |
.byte 0x24, 0x00, 0x36, 0x00 |
.byte 0x1b, 0x00, 0x36, 0x00 |
.byte 0x12, 0x00, 0x36, 0x00 |
.byte 0x09, 0x00, 0x36, 0x00 |
.byte 0x00, 0x00, 0x36, 0x00 |
.byte 0x3f, 0x3f, 0x2d, 0x00 |
.byte 0x36, 0x3f, 0x2d, 0x00 |
.byte 0x2d, 0x3f, 0x2d, 0x00 |
.byte 0x24, 0x3f, 0x2d, 0x00 |
.byte 0x1b, 0x3f, 0x2d, 0x00 |
.byte 0x12, 0x3f, 0x2d, 0x00 |
.byte 0x09, 0x3f, 0x2d, 0x00 |
.byte 0x00, 0x3f, 0x2d, 0x00 |
.byte 0x3f, 0x2a, 0x2d, 0x00 |
.byte 0x36, 0x2a, 0x2d, 0x00 |
.byte 0x2d, 0x2a, 0x2d, 0x00 |
.byte 0x24, 0x2a, 0x2d, 0x00 |
.byte 0x1b, 0x2a, 0x2d, 0x00 |
.byte 0x12, 0x2a, 0x2d, 0x00 |
.byte 0x09, 0x2a, 0x2d, 0x00 |
.byte 0x00, 0x2a, 0x2d, 0x00 |
.byte 0x3f, 0x15, 0x2d, 0x00 |
.byte 0x36, 0x15, 0x2d, 0x00 |
.byte 0x2d, 0x15, 0x2d, 0x00 |
.byte 0x24, 0x15, 0x2d, 0x00 |
.byte 0x1b, 0x15, 0x2d, 0x00 |
.byte 0x12, 0x15, 0x2d, 0x00 |
.byte 0x09, 0x15, 0x2d, 0x00 |
.byte 0x00, 0x15, 0x2d, 0x00 |
.byte 0x3f, 0x00, 0x2d, 0x00 |
.byte 0x36, 0x00, 0x2d, 0x00 |
.byte 0x2d, 0x00, 0x2d, 0x00 |
.byte 0x24, 0x00, 0x2d, 0x00 |
.byte 0x1b, 0x00, 0x2d, 0x00 |
.byte 0x12, 0x00, 0x2d, 0x00 |
.byte 0x09, 0x00, 0x2d, 0x00 |
.byte 0x00, 0x00, 0x2d, 0x00 |
.byte 0x3f, 0x3f, 0x24, 0x00 |
.byte 0x36, 0x3f, 0x24, 0x00 |
.byte 0x2d, 0x3f, 0x24, 0x00 |
.byte 0x24, 0x3f, 0x24, 0x00 |
.byte 0x1b, 0x3f, 0x24, 0x00 |
.byte 0x12, 0x3f, 0x24, 0x00 |
.byte 0x09, 0x3f, 0x24, 0x00 |
.byte 0x00, 0x3f, 0x24, 0x00 |
.byte 0x3f, 0x2a, 0x24, 0x00 |
.byte 0x36, 0x2a, 0x24, 0x00 |
.byte 0x2d, 0x2a, 0x24, 0x00 |
.byte 0x24, 0x2a, 0x24, 0x00 |
.byte 0x1b, 0x2a, 0x24, 0x00 |
.byte 0x12, 0x2a, 0x24, 0x00 |
.byte 0x09, 0x2a, 0x24, 0x00 |
.byte 0x00, 0x2a, 0x24, 0x00 |
.byte 0x3f, 0x15, 0x24, 0x00 |
.byte 0x36, 0x15, 0x24, 0x00 |
.byte 0x2d, 0x15, 0x24, 0x00 |
.byte 0x24, 0x15, 0x24, 0x00 |
.byte 0x1b, 0x15, 0x24, 0x00 |
.byte 0x12, 0x15, 0x24, 0x00 |
.byte 0x09, 0x15, 0x24, 0x00 |
.byte 0x00, 0x15, 0x24, 0x00 |
.byte 0x3f, 0x00, 0x24, 0x00 |
.byte 0x36, 0x00, 0x24, 0x00 |
.byte 0x2d, 0x00, 0x24, 0x00 |
.byte 0x24, 0x00, 0x24, 0x00 |
.byte 0x1b, 0x00, 0x24, 0x00 |
.byte 0x12, 0x00, 0x24, 0x00 |
.byte 0x09, 0x00, 0x24, 0x00 |
.byte 0x00, 0x00, 0x24, 0x00 |
.byte 0x3f, 0x3f, 0x1b, 0x00 |
.byte 0x36, 0x3f, 0x1b, 0x00 |
.byte 0x2d, 0x3f, 0x1b, 0x00 |
.byte 0x24, 0x3f, 0x1b, 0x00 |
.byte 0x1b, 0x3f, 0x1b, 0x00 |
.byte 0x12, 0x3f, 0x1b, 0x00 |
.byte 0x09, 0x3f, 0x1b, 0x00 |
.byte 0x00, 0x3f, 0x1b, 0x00 |
.byte 0x3f, 0x2a, 0x1b, 0x00 |
.byte 0x36, 0x2a, 0x1b, 0x00 |
.byte 0x2d, 0x2a, 0x1b, 0x00 |
.byte 0x24, 0x2a, 0x1b, 0x00 |
.byte 0x1b, 0x2a, 0x1b, 0x00 |
.byte 0x12, 0x2a, 0x1b, 0x00 |
.byte 0x09, 0x2a, 0x1b, 0x00 |
.byte 0x00, 0x2a, 0x1b, 0x00 |
.byte 0x3f, 0x15, 0x1b, 0x00 |
.byte 0x36, 0x15, 0x1b, 0x00 |
.byte 0x2d, 0x15, 0x1b, 0x00 |
.byte 0x24, 0x15, 0x1b, 0x00 |
.byte 0x1b, 0x15, 0x1b, 0x00 |
.byte 0x12, 0x15, 0x1b, 0x00 |
.byte 0x09, 0x15, 0x1b, 0x00 |
.byte 0x00, 0x15, 0x1b, 0x00 |
.byte 0x3f, 0x00, 0x1b, 0x00 |
.byte 0x36, 0x00, 0x1b, 0x00 |
.byte 0x2d, 0x00, 0x1b, 0x00 |
.byte 0x24, 0x00, 0x1b, 0x00 |
.byte 0x1b, 0x00, 0x1b, 0x00 |
.byte 0x12, 0x00, 0x1b, 0x00 |
.byte 0x09, 0x00, 0x1b, 0x00 |
.byte 0x00, 0x00, 0x1b, 0x00 |
.byte 0x3f, 0x3f, 0x12, 0x00 |
.byte 0x36, 0x3f, 0x12, 0x00 |
.byte 0x2d, 0x3f, 0x12, 0x00 |
.byte 0x24, 0x3f, 0x12, 0x00 |
.byte 0x1b, 0x3f, 0x12, 0x00 |
.byte 0x12, 0x3f, 0x12, 0x00 |
.byte 0x09, 0x3f, 0x12, 0x00 |
.byte 0x00, 0x3f, 0x12, 0x00 |
.byte 0x3f, 0x2a, 0x12, 0x00 |
.byte 0x36, 0x2a, 0x12, 0x00 |
.byte 0x2d, 0x2a, 0x12, 0x00 |
.byte 0x24, 0x2a, 0x12, 0x00 |
.byte 0x1b, 0x2a, 0x12, 0x00 |
.byte 0x12, 0x2a, 0x12, 0x00 |
.byte 0x09, 0x2a, 0x12, 0x00 |
.byte 0x00, 0x2a, 0x12, 0x00 |
.byte 0x3f, 0x15, 0x12, 0x00 |
.byte 0x36, 0x15, 0x12, 0x00 |
.byte 0x2d, 0x15, 0x12, 0x00 |
.byte 0x24, 0x15, 0x12, 0x00 |
.byte 0x1b, 0x15, 0x12, 0x00 |
.byte 0x12, 0x15, 0x12, 0x00 |
.byte 0x09, 0x15, 0x12, 0x00 |
.byte 0x00, 0x15, 0x12, 0x00 |
.byte 0x3f, 0x00, 0x12, 0x00 |
.byte 0x36, 0x00, 0x12, 0x00 |
.byte 0x2d, 0x00, 0x12, 0x00 |
.byte 0x24, 0x00, 0x12, 0x00 |
.byte 0x1b, 0x00, 0x12, 0x00 |
.byte 0x12, 0x00, 0x12, 0x00 |
.byte 0x09, 0x00, 0x12, 0x00 |
.byte 0x00, 0x00, 0x12, 0x00 |
.byte 0x3f, 0x3f, 0x09, 0x00 |
.byte 0x36, 0x3f, 0x09, 0x00 |
.byte 0x2d, 0x3f, 0x09, 0x00 |
.byte 0x24, 0x3f, 0x09, 0x00 |
.byte 0x1b, 0x3f, 0x09, 0x00 |
.byte 0x12, 0x3f, 0x09, 0x00 |
.byte 0x09, 0x3f, 0x09, 0x00 |
.byte 0x00, 0x3f, 0x09, 0x00 |
.byte 0x3f, 0x2a, 0x09, 0x00 |
.byte 0x36, 0x2a, 0x09, 0x00 |
.byte 0x2d, 0x2a, 0x09, 0x00 |
.byte 0x24, 0x2a, 0x09, 0x00 |
.byte 0x1b, 0x2a, 0x09, 0x00 |
.byte 0x12, 0x2a, 0x09, 0x00 |
.byte 0x09, 0x2a, 0x09, 0x00 |
.byte 0x00, 0x2a, 0x09, 0x00 |
.byte 0x3f, 0x15, 0x09, 0x00 |
.byte 0x36, 0x15, 0x09, 0x00 |
.byte 0x2d, 0x15, 0x09, 0x00 |
.byte 0x24, 0x15, 0x09, 0x00 |
.byte 0x1b, 0x15, 0x09, 0x00 |
.byte 0x12, 0x15, 0x09, 0x00 |
.byte 0x09, 0x15, 0x09, 0x00 |
.byte 0x00, 0x15, 0x09, 0x00 |
.byte 0x3f, 0x00, 0x09, 0x00 |
.byte 0x36, 0x00, 0x09, 0x00 |
.byte 0x2d, 0x00, 0x09, 0x00 |
.byte 0x24, 0x00, 0x09, 0x00 |
.byte 0x1b, 0x00, 0x09, 0x00 |
.byte 0x12, 0x00, 0x09, 0x00 |
.byte 0x09, 0x00, 0x09, 0x00 |
.byte 0x00, 0x00, 0x09, 0x00 |
.byte 0x3f, 0x3f, 0x00, 0x00 |
.byte 0x36, 0x3f, 0x00, 0x00 |
.byte 0x2d, 0x3f, 0x00, 0x00 |
.byte 0x24, 0x3f, 0x00, 0x00 |
.byte 0x1b, 0x3f, 0x00, 0x00 |
.byte 0x12, 0x3f, 0x00, 0x00 |
.byte 0x09, 0x3f, 0x00, 0x00 |
.byte 0x00, 0x3f, 0x00, 0x00 |
.byte 0x3f, 0x2a, 0x00, 0x00 |
.byte 0x36, 0x2a, 0x00, 0x00 |
.byte 0x2d, 0x2a, 0x00, 0x00 |
.byte 0x24, 0x2a, 0x00, 0x00 |
.byte 0x1b, 0x2a, 0x00, 0x00 |
.byte 0x12, 0x2a, 0x00, 0x00 |
.byte 0x09, 0x2a, 0x00, 0x00 |
.byte 0x00, 0x2a, 0x00, 0x00 |
.byte 0x3f, 0x15, 0x00, 0x00 |
.byte 0x36, 0x15, 0x00, 0x00 |
.byte 0x2d, 0x15, 0x00, 0x00 |
.byte 0x24, 0x15, 0x00, 0x00 |
.byte 0x1b, 0x15, 0x00, 0x00 |
.byte 0x12, 0x15, 0x00, 0x00 |
.byte 0x09, 0x15, 0x00, 0x00 |
.byte 0x00, 0x15, 0x00, 0x00 |
.byte 0x3f, 0x00, 0x00, 0x00 |
.byte 0x36, 0x00, 0x00, 0x00 |
.byte 0x2d, 0x00, 0x00, 0x00 |
.byte 0x24, 0x00, 0x00, 0x00 |
.byte 0x1b, 0x00, 0x00, 0x00 |
.byte 0x12, 0x00, 0x00, 0x00 |
.byte 0x09, 0x00, 0x00, 0x00 |
.byte 0x00, 0x00, 0x00, 0x00 |
/branches/dynload/kernel/arch/ia32/src/ia32.c |
---|
93,7 → 93,7 |
vesa_init(); |
else |
#endif |
ega_init(); /* video */ |
ega_init(); /* video */ |
/* Enable debugger */ |
debugger_init(); |
159,15 → 159,8 |
*/ |
void arch_grab_console(void) |
{ |
#ifdef CONFIG_FB |
vesa_redraw(); |
#else |
ega_redraw(); |
#endif |
i8042_grab(); |
} |
/** Return console to userspace |
* |
*/ |
/branches/dynload/kernel/arch/ia32/include/cpu.h |
---|
51,10 → 51,10 |
#include <arch/asm.h> |
typedef struct { |
unsigned int vendor; |
unsigned int family; |
unsigned int model; |
unsigned int stepping; |
int vendor; |
int family; |
int model; |
int stepping; |
struct tss *tss; |
count_t iomapver_copy; /** Copy of TASK's I/O Permission bitmap generation count. */ |
/branches/dynload/kernel/arch/ia32/include/mm/as.h |
---|
42,7 → 42,7 |
#define USER_ADDRESS_SPACE_START_ARCH ((unsigned long) 0x00000000) |
#define USER_ADDRESS_SPACE_END_ARCH ((unsigned long) 0x7fffffff) |
#define USTACK_ADDRESS_ARCH (USER_ADDRESS_SPACE_END_ARCH - (PAGE_SIZE - 1)) |
#define USTACK_ADDRESS_ARCH (USER_ADDRESS_SPACE_END_ARCH-(PAGE_SIZE-1)) |
typedef struct { |
} as_arch_t; |
/branches/dynload/kernel/arch/ia32/include/drivers/ega.h |
---|
40,7 → 40,6 |
#define ROWS 25 |
#define SCREEN (ROW * ROWS) |
extern void ega_redraw(void); |
extern void ega_init(void); |
#endif |
/branches/dynload/kernel/arch/ia32/include/drivers/vesa.h |
---|
36,7 → 36,6 |
#define KERN_ia32_VESA_H_ |
extern int vesa_present(void); |
extern void vesa_redraw(void); |
extern void vesa_init(void); |
#endif |
/branches/dynload/kernel/arch/amd64/include/drivers/vesa.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006-2006 Jakub Vana |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup amd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KERN_amd64_VESA_H_ |
#define KERN_amd64_VESA_H_ |
int vesa_present(void); |
void vesa_init(void); |
#endif |
/** @} |
*/ |
/branches/dynload/kernel/arch/amd64/include/drivers/i8254.h |
---|
0,0 → 1,0 |
link ../../../ia32/include/drivers/i8254.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
/branches/dynload/kernel/arch/amd64/include/drivers/i8259.h |
---|
0,0 → 1,0 |
link ../../../ia32/include/drivers/i8259.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
/branches/dynload/kernel/arch/amd64/include/drivers/ega.h |
---|
0,0 → 1,0 |
link ../../../ia32/include/drivers/ega.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
/branches/dynload/kernel/arch/amd64/include/drivers/i8042.h |
---|
0,0 → 1,0 |
link ../../../ia32/include/drivers/i8042.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
/branches/dynload/kernel/arch/amd64/src/debugger.c |
---|
54,8 → 54,6 |
static bpinfo_t breakpoints[BKPOINTS_MAX]; |
SPINLOCK_INITIALIZE(bkpoint_lock); |
#ifdef CONFIG_KCONSOLE |
static int cmd_print_breakpoints(cmd_arg_t *argv); |
static cmd_info_t bkpts_info = { |
.name = "bkpts", |
101,9 → 99,44 |
.argv = &addw_argv |
}; |
#endif /* CONFIG_DEBUG_AS_WATCHPOINT */ |
#endif /* CONFIG_KCONSOLE */ |
#endif |
/** Print table of active breakpoints */ |
int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused))) |
{ |
unsigned int i; |
char *symbol; |
#ifdef __32_BITS__ |
printf("# Count Address In symbol\n"); |
printf("-- ----- ---------- ---------\n"); |
#endif |
#ifdef __64_BITS__ |
printf("# Count Address In symbol\n"); |
printf("-- ----- ------------------ ---------\n"); |
#endif |
for (i = 0; i < BKPOINTS_MAX; i++) |
if (breakpoints[i].address) { |
symbol = get_symtab_entry(breakpoints[i].address); |
#ifdef __32_BITS__ |
printf("%-2u %-5d %#10zx %s\n", i, |
breakpoints[i].counter, breakpoints[i].address, |
symbol); |
#endif |
#ifdef __64_BITS__ |
printf("%-2u %-5d %#18zx %s\n", i, |
breakpoints[i].counter, breakpoints[i].address, |
symbol); |
#endif |
} |
return 1; |
} |
/* Setup DR register according to table */ |
static void setup_dr(int curidx) |
{ |
234,12 → 267,10 |
} |
printf("Reached breakpoint %d:%lx(%s)\n", slot, getip(istate), |
get_symtab_entry(getip(istate))); |
#ifdef CONFIG_KCONSOLE |
atomic_set(&haltstate, 1); |
kconsole("debug", "Debug console ready (type 'exit' to continue)\n", false); |
atomic_set(&haltstate, 0); |
#endif |
printf("***Type 'exit' to exit kconsole.\n"); |
atomic_set(&haltstate,1); |
kconsole((void *) "debug"); |
atomic_set(&haltstate,0); |
} |
void breakpoint_del(int slot) |
268,8 → 299,42 |
#endif |
} |
#ifndef CONFIG_DEBUG_AS_WATCHPOINT |
/** Remove breakpoint from table */ |
int cmd_del_breakpoint(cmd_arg_t *argv) |
{ |
unative_t bpno = argv->intval; |
if (bpno > BKPOINTS_MAX) { |
printf("Invalid breakpoint number.\n"); |
return 0; |
} |
breakpoint_del(argv->intval); |
return 1; |
} |
/** Add new breakpoint to table */ |
static int cmd_add_breakpoint(cmd_arg_t *argv) |
{ |
int flags; |
int id; |
if (argv == &add_argv) { |
flags = BKPOINT_INSTR; |
} else { /* addwatchp */ |
flags = BKPOINT_WRITE; |
} |
printf("Adding breakpoint on address: %p\n", argv->intval); |
id = breakpoint_add((void *)argv->intval, flags, -1); |
if (id < 0) |
printf("Add breakpoint failed.\n"); |
else |
printf("Added breakpoint %d.\n", id); |
return 1; |
} |
#endif |
static void debug_exception(int n __attribute__((unused)), istate_t *istate) |
{ |
unative_t dr6; |
314,26 → 379,24 |
for (i = 0; i < BKPOINTS_MAX; i++) |
breakpoints[i].address = NULL; |
#ifdef CONFIG_KCONSOLE |
cmd_initialize(&bkpts_info); |
if (!cmd_register(&bkpts_info)) |
printf("Cannot register command %s\n", bkpts_info.name); |
panic("could not register command %s\n", bkpts_info.name); |
#ifndef CONFIG_DEBUG_AS_WATCHPOINT |
cmd_initialize(&delbkpt_info); |
if (!cmd_register(&delbkpt_info)) |
printf("Cannot register command %s\n", delbkpt_info.name); |
panic("could not register command %s\n", delbkpt_info.name); |
cmd_initialize(&addbkpt_info); |
if (!cmd_register(&addbkpt_info)) |
printf("Cannot register command %s\n", addbkpt_info.name); |
panic("could not register command %s\n", addbkpt_info.name); |
cmd_initialize(&addwatchp_info); |
if (!cmd_register(&addwatchp_info)) |
printf("Cannot register command %s\n", addwatchp_info.name); |
#endif /* CONFIG_DEBUG_AS_WATCHPOINT */ |
#endif /* CONFIG_KCONSOLE */ |
panic("could not register command %s\n", addwatchp_info.name); |
#endif |
exc_register(VECTOR_DEBUG, "debugger", debug_exception); |
#ifdef CONFIG_SMP |
341,79 → 404,5 |
#endif |
} |
#ifdef CONFIG_KCONSOLE |
/** Print table of active breakpoints */ |
int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused))) |
{ |
unsigned int i; |
char *symbol; |
#ifdef __32_BITS__ |
printf("# Count Address In symbol\n"); |
printf("-- ----- ---------- ---------\n"); |
#endif |
#ifdef __64_BITS__ |
printf("# Count Address In symbol\n"); |
printf("-- ----- ------------------ ---------\n"); |
#endif |
for (i = 0; i < BKPOINTS_MAX; i++) |
if (breakpoints[i].address) { |
symbol = get_symtab_entry(breakpoints[i].address); |
#ifdef __32_BITS__ |
printf("%-2u %-5d %#10zx %s\n", i, |
breakpoints[i].counter, breakpoints[i].address, |
symbol); |
#endif |
#ifdef __64_BITS__ |
printf("%-2u %-5d %#18zx %s\n", i, |
breakpoints[i].counter, breakpoints[i].address, |
symbol); |
#endif |
} |
return 1; |
} |
#ifndef CONFIG_DEBUG_AS_WATCHPOINT |
/** Remove breakpoint from table */ |
int cmd_del_breakpoint(cmd_arg_t *argv) |
{ |
unative_t bpno = argv->intval; |
if (bpno > BKPOINTS_MAX) { |
printf("Invalid breakpoint number.\n"); |
return 0; |
} |
breakpoint_del(argv->intval); |
return 1; |
} |
/** Add new breakpoint to table */ |
static int cmd_add_breakpoint(cmd_arg_t *argv) |
{ |
int flags; |
int id; |
if (argv == &add_argv) { |
flags = BKPOINT_INSTR; |
} else { /* addwatchp */ |
flags = BKPOINT_WRITE; |
} |
printf("Adding breakpoint on address: %p\n", argv->intval); |
id = breakpoint_add((void *)argv->intval, flags, -1); |
if (id < 0) |
printf("Add breakpoint failed.\n"); |
else |
printf("Added breakpoint %d.\n", id); |
return 1; |
} |
#endif /* CONFIG_DEBUG_AS_WATCHPOINT */ |
#endif /* CONFIG_KCONSOLE */ |
/** @} |
*/ |
/branches/dynload/kernel/arch/amd64/src/amd64.c |
---|
210,7 → 210,6 |
{ |
i8042_grab(); |
} |
/** Return console to userspace |
* |
*/ |
/branches/dynload/kernel/arch/ia32xen/src/mm/tlb.c |
---|
63,7 → 63,7 |
* @param page Address of the first page whose entry is to be invalidated. |
* @param cnt Number of entries to invalidate. |
*/ |
void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, count_t cnt) |
void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt) |
{ |
unsigned int i; |
/branches/dynload/contrib/toolchain/toolchain.sparc64.sh |
---|
19,8 → 19,8 |
CROSS_PREFIX="/usr/local" |
fi |
BINUTILS_VERSION="2.19" |
GCC_VERSION="4.3.2" |
BINUTILS_VERSION="2.18" |
GCC_VERSION="4.3.1" |
BINUTILS="binutils-${BINUTILS_VERSION}.tar.gz" |
GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2" |
/branches/dynload/HelenOS.config |
---|
48,8 → 48,8 |
! [PLATFORM=mips32] MACHINE (choice) |
# Machine type |
@ "ski" Ski ia64 simulator |
@ "i460GX" i460GX chipset machine |
@ "ski" Ski ia64 simulator |
! [PLATFORM=ia64] MACHINE (choice) |
# Compiler |