Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 322 → Rev 323

/SPARTAN/trunk/doc/TODO
25,4 → 25,3
- Task changed to clear AM in CR0 so that
the alignment check is disabled globally
+ make emulated architectures also work on real hardware
+ bring in support for other architectures (e.g. PowerPC)
/SPARTAN/trunk/src/debug/print.c
58,13 → 58,13
if (num<0.0) {
putchar('-');
num=num*-1.0;
}
}
 
 
if (fmath_is_infinity(num)) {
print_str("Inf");
return;
}
}
 
if ((modifier=='E')||(modifier=='e')) {
intval2=fmath_fint(fmath_get_decimal_exponent(num),&intval);
72,20 → 72,23
if ((intval2<0.0)) exponent--;
num = num / ((fmath_dpow(10.0,exponent)));
print_double(num,modifier+1,precision); //modifier+1 = E => F or e => f
print_double(num,modifier+1,precision); /* modifier+1 = E => F or e => f */
putchar(modifier);
if (exponent<0) {
putchar('-');
exponent*=-1;
}
}
print_number(exponent,10);
return;
}
}
//TODO: rounding constant - when we got fraction >= 0.5, we must increment last printed number
/* TODO: rounding constant - when we got fraction >= 0.5, we must increment last printed number */
 
/* Here is problem with cumulative error while printing big double values -> we will divide
the number with a power of 10, print new number with better method for small numbers and then print decimal point at correct position */
/*
* Here is a problem with cumulative error while printing big double values -> we will divide
* the number with a power of 10, print new number with better method for small numbers and
* then print decimal point at correct position.
*/
fmath_fint(fmath_get_decimal_exponent(num),&intval);
135,7 → 138,7
counter = (counter>=DEFAULT_DOUBLE_BUFFER_SIZE?DEFAULT_DOUBLE_BUFFER_SIZE:counter);
while (counter>0) {
putchar(buf[--counter]);
};
}
return;
}
 
236,6 → 239,16
* and printed in standard hexadecimal format (only significant
* digits).
* X As with 'x', but '0x' is prefixed.
* . The decimal number following period will be treated as precision
* for printing floating point numbers. One of 'e', 'E', 'f' or 'F'
* must follow.
* e The next variant argument is treated as double precision float
* and printed in exponent notation with only one digit before decimal point
* in specified precision. The exponent sign is printed as 'e'.
* E As with 'e', but the exponent sign is printed as 'E'.
* f The next variant argument is treated as double precision float
* and printed in decimal notation in specified precision.
* F As with 'f'.
*
* All other characters from fmt except the formatting directives
* are printed in verbatim.
259,110 → 272,105
while (c = fmt[i++]) {
switch (c) {
 
/* control character */
case '%':
precision = DEFAULT_DOUBLE_PRECISION;
if (fmt[i]=='.') {
precision=0;
precision = DEFAULT_DOUBLE_PRECISION;
if (fmt[i]=='.') {
precision=0;
c=fmt[++i];
while((c>='0')&&(c<='9')) {
precision = precision*10 + c - '0';
c=fmt[++i];
while((c>='0')&&(c<='9')) {
precision = precision*10 + c - '0';
c=fmt[++i];
}
}
}
switch (c = fmt[i++]) {
switch (c = fmt[i++]) {
 
/* percentile itself */
case '%':
break;
/* percentile itself */
case '%':
break;
 
/*
* String and character conversions.
*/
case 's':
print_str(va_arg(ap, char_ptr));
goto loop;
/*
* String and character conversions.
*/
case 's':
print_str(va_arg(ap, char_ptr));
goto loop;
 
case 'c':
c = (char) va_arg(ap, int);
break;
case 'c':
c = (char) va_arg(ap, int);
break;
 
/*
* Hexadecimal conversions with fixed width.
*/
case 'P':
print_str("0x");
case 'p':
print_fixed_hex(va_arg(ap, __native), sizeof(__native));
goto loop;
/*
* Hexadecimal conversions with fixed width.
*/
case 'P':
print_str("0x");
case 'p':
print_fixed_hex(va_arg(ap, __native), sizeof(__native));
goto loop;
 
case 'Q':
print_str("0x");
case 'q':
print_fixed_hex(va_arg(ap, __u64), INT64);
goto loop;
case 'Q':
print_str("0x");
case 'q':
print_fixed_hex(va_arg(ap, __u64), INT64);
goto loop;
 
case 'L':
print_str("0x");
case 'l':
print_fixed_hex(va_arg(ap, __native), INT32);
goto loop;
case 'L':
print_str("0x");
case 'l':
print_fixed_hex(va_arg(ap, __native), INT32);
goto loop;
 
case 'W':
print_str("0x");
case 'w':
print_fixed_hex(va_arg(ap, __native), INT16);
goto loop;
case 'W':
print_str("0x");
case 'w':
print_fixed_hex(va_arg(ap, __native), INT16);
goto loop;
 
case 'B':
print_str("0x");
case 'b':
print_fixed_hex(va_arg(ap, __native), INT8);
goto loop;
case 'B':
print_str("0x");
case 'b':
print_fixed_hex(va_arg(ap, __native), INT8);
goto loop;
 
/*
* Floating point conversions.
*/
case 'F':
print_double(va_arg(ap, double),'F',precision);
goto loop;
/*
* Floating point conversions.
*/
case 'F':
print_double(va_arg(ap, double),'F',precision);
goto loop;
case 'f':
print_double(va_arg(ap, double),'f',precision);
goto loop;
case 'f':
print_double(va_arg(ap, double),'f',precision);
goto loop;
case 'E':
print_double(va_arg(ap, double),'E',precision);
goto loop;
case 'e':
print_double(va_arg(ap, double),'e',precision);
goto loop;
case 'E':
print_double(va_arg(ap, double),'E',precision);
goto loop;
case 'e':
print_double(va_arg(ap, double),'e',precision);
goto loop;
/*
* Decimal and hexadecimal conversions.
*/
case 'd':
print_number(va_arg(ap, __native), 10);
goto loop;
/*
* Decimal and hexadecimal conversions.
*/
case 'd':
print_number(va_arg(ap, __native), 10);
goto loop;
 
case 'X':
print_str("0x");
case 'x':
print_number(va_arg(ap, __native), 16);
goto loop;
case 'X':
print_str("0x");
case 'x':
print_number(va_arg(ap, __native), 16);
goto loop;
/*
* Bad formatting.
*/
default:
goto out;
}
/*
* Bad formatting.
*/
default:
goto out;
}
 
default: putchar(c);
}
/SPARTAN/trunk/arch/amd64/src/mm/page.c
50,7 → 50,6
bootstrap_dba = dba;
 
/*
* Identity mapping for all frames.
* PA2KA(identity) mapping for all frames.
*/
for (i = 0; i < frames; i++) {
/SPARTAN/trunk/arch/ia32/src/asm.S
358,8 → 358,6
utext_size:
.long utext_end - utext
 
 
#.section K_DATA_START
.global interrupt_handler_size
 
interrupt_handler_size: .long (h_end-h_start)/IDT_ITEMS
/SPARTAN/trunk/arch/ia32/src/boot/boot.S
53,11 → 53,11
xorw %ax, %ax
movw %ax, %ds
movw %ax, %ss # initialize stack segment register
movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer
movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer
call memmap_arch_init
lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register
lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register
movl %cr0, %eax
orl $0x1, %eax
82,10 → 82,10
movw %ax, %es
movw %ax, %gs
movw %ax, %fs
movw %ax, %ds # kernel data + stack
movw %ax, %ds # kernel data + stack
movw %ax, %ss
movb $0xd1, %al # enable A20 using the keyboard controller
movb $0xd1, %al # enable A20 using the keyboard controller
outb %al, $0x64
movb $0xdf, %al
outb %al, $0x60
96,29 → 96,29
cld
rep movsb
call map_kernel # map kernel and turn paging on
call map_kernel # map kernel and turn paging on
call main_bsp # never returns
call main_bsp # never returns
 
cli
hlt
multiboot_image_start:
movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer
movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer
lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register
lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register
 
movw $KDATA, %cx
movw %cx, %es
movw %cx, %gs
movw %cx, %fs
movw %cx, %ds # kernel data + stack
movw %cx, %ds # kernel data + stack
movw %cx, %ss
jmpl $KTEXT, $multiboot_meeting_point + BOOT_OFFSET
multiboot_meeting_point:
pushl %ebx # save parameters from GRUB
pushl %ebx # save parameters from GRUB
pushl %eax
movl $BOOTSTRAP_OFFSET + BOOT_OFFSET, %esi
127,11 → 127,11
cld
rep movsb
call map_kernel # map kernel and turn paging on
call map_kernel # map kernel and turn paging on
popl %eax
popl %ebx
cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature
cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature
je valid_boot
xorl %ecx, %ecx # no memory size or map available
203,7 → 203,7
invalid_boot:
call main_bsp - BOOT_OFFSET # never returns
call main_bsp - BOOT_OFFSET # never returns
 
cli
hlt
216,13 → 216,13
#
movl %cr4, %ecx
orl $(1<<4), %ecx
movl %ecx, %cr4 # turn PSE on
movl %ecx, %cr4 # turn PSE on
movl $((1<<7)|(1<<0)), %eax
movl %eax, page_directory # mapping 0x00000000 => 0x00000000
movl %eax, page_directory # mapping 0x00000000 => 0x00000000
 
movl $(page_directory+2048), %edx
movl %eax, (%edx) # mapping 0x80000000 => 0x00000000
movl %eax, (%edx) # mapping 0x80000000 => 0x00000000
 
leal page_directory, %eax
movl %eax, %cr3
/SPARTAN/trunk/arch/ia32/src/mm/page.c
53,7 → 53,6
bootstrap_dba = dba;
/*
* Identity mapping for all frames.
* PA2KA(identity) mapping for all frames.
*/
for (i = 0; i < frames; i++)