Changeset b0edf3b2 in mainline
- Timestamp:
- 2005-09-09T11:59:25Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 38de8a5
- Parents:
- ba1b7393
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/mm/page.c
rba1b7393 rb0edf3b2 51 51 52 52 /* 53 * Identity mapping for all frames.54 53 * PA2KA(identity) mapping for all frames. 55 54 */ -
arch/ia32/src/asm.S
rba1b7393 rb0edf3b2 359 359 .long utext_end - utext 360 360 361 362 #.section K_DATA_START363 361 .global interrupt_handler_size 364 362 -
arch/ia32/src/boot/boot.S
rba1b7393 rb0edf3b2 54 54 movw %ax, %ds 55 55 movw %ax, %ss # initialize stack segment register 56 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer56 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 57 57 58 58 call memmap_arch_init 59 59 60 lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register60 lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register 61 61 62 62 movl %cr0, %eax … … 83 83 movw %ax, %gs 84 84 movw %ax, %fs 85 movw %ax, %ds # kernel data + stack85 movw %ax, %ds # kernel data + stack 86 86 movw %ax, %ss 87 87 88 movb $0xd1, %al # enable A20 using the keyboard controller88 movb $0xd1, %al # enable A20 using the keyboard controller 89 89 outb %al, $0x64 90 90 movb $0xdf, %al … … 97 97 rep movsb 98 98 99 call map_kernel # map kernel and turn paging on100 101 call main_bsp # never returns99 call map_kernel # map kernel and turn paging on 100 101 call main_bsp # never returns 102 102 103 103 cli … … 105 105 106 106 multiboot_image_start: 107 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer108 109 lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register107 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 108 109 lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register 110 110 111 111 movw $KDATA, %cx … … 113 113 movw %cx, %gs 114 114 movw %cx, %fs 115 movw %cx, %ds 115 movw %cx, %ds # kernel data + stack 116 116 movw %cx, %ss 117 117 … … 119 119 multiboot_meeting_point: 120 120 121 pushl %ebx 121 pushl %ebx # save parameters from GRUB 122 122 pushl %eax 123 123 … … 128 128 rep movsb 129 129 130 call map_kernel 130 call map_kernel # map kernel and turn paging on 131 131 132 132 popl %eax 133 133 popl %ebx 134 cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature134 cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature 135 135 je valid_boot 136 136 … … 204 204 invalid_boot: 205 205 206 call main_bsp - BOOT_OFFSET 206 call main_bsp - BOOT_OFFSET # never returns 207 207 208 208 cli … … 217 217 movl %cr4, %ecx 218 218 orl $(1<<4), %ecx 219 movl %ecx, %cr4 # turn PSE on219 movl %ecx, %cr4 # turn PSE on 220 220 221 221 movl $((1<<7)|(1<<0)), %eax 222 movl %eax, page_directory # mapping 0x00000000 => 0x00000000222 movl %eax, page_directory # mapping 0x00000000 => 0x00000000 223 223 224 224 movl $(page_directory+2048), %edx 225 movl %eax, (%edx) # mapping 0x80000000 => 0x00000000225 movl %eax, (%edx) # mapping 0x80000000 => 0x00000000 226 226 227 227 leal page_directory, %eax -
arch/ia32/src/mm/page.c
rba1b7393 rb0edf3b2 54 54 55 55 /* 56 * Identity mapping for all frames.57 56 * PA2KA(identity) mapping for all frames. 58 57 */ -
doc/TODO
rba1b7393 rb0edf3b2 26 26 the alignment check is disabled globally 27 27 + make emulated architectures also work on real hardware 28 + bring in support for other architectures (e.g. PowerPC) -
src/debug/print.c
rba1b7393 rb0edf3b2 59 59 putchar('-'); 60 60 num=num*-1.0; 61 61 } 62 62 63 63 … … 65 65 print_str("Inf"); 66 66 return; 67 67 } 68 68 69 69 if ((modifier=='E')||(modifier=='e')) { … … 73 73 num = num / ((fmath_dpow(10.0,exponent))); 74 74 75 print_double(num,modifier+1,precision); / /modifier+1 = E => F or e => f75 print_double(num,modifier+1,precision); /* modifier+1 = E => F or e => f */ 76 76 putchar(modifier); 77 77 if (exponent<0) { 78 78 putchar('-'); 79 79 exponent*=-1; 80 80 } 81 81 print_number(exponent,10); 82 82 return; 83 83 } 84 84 85 //TODO: rounding constant - when we got fraction >= 0.5, we must increment last printed number 86 87 /* Here is problem with cumulative error while printing big double values -> we will divide 88 the number with a power of 10, print new number with better method for small numbers and then print decimal point at correct position */ 85 /* TODO: rounding constant - when we got fraction >= 0.5, we must increment last printed number */ 86 87 /* 88 * Here is a problem with cumulative error while printing big double values -> we will divide 89 * the number with a power of 10, print new number with better method for small numbers and 90 * then print decimal point at correct position. 91 */ 89 92 90 93 fmath_fint(fmath_get_decimal_exponent(num),&intval); … … 136 139 while (counter>0) { 137 140 putchar(buf[--counter]); 138 } ;141 } 139 142 return; 140 143 } … … 237 240 * digits). 238 241 * X As with 'x', but '0x' is prefixed. 242 * . The decimal number following period will be treated as precision 243 * for printing floating point numbers. One of 'e', 'E', 'f' or 'F' 244 * must follow. 245 * e The next variant argument is treated as double precision float 246 * and printed in exponent notation with only one digit before decimal point 247 * in specified precision. The exponent sign is printed as 'e'. 248 * E As with 'e', but the exponent sign is printed as 'E'. 249 * f The next variant argument is treated as double precision float 250 * and printed in decimal notation in specified precision. 251 * F As with 'f'. 239 252 * 240 253 * All other characters from fmt except the formatting directives … … 260 273 switch (c) { 261 274 262 263 264 275 /* control character */ 265 276 case '%': 277 precision = DEFAULT_DOUBLE_PRECISION; 278 if (fmt[i]=='.') { 279 precision=0; 280 c=fmt[++i]; 281 while((c>='0')&&(c<='9')) { 282 precision = precision*10 + c - '0'; 283 c=fmt[++i]; 284 } 285 } 266 286 267 precision = DEFAULT_DOUBLE_PRECISION; 268 if (fmt[i]=='.') { 269 precision=0; 270 c=fmt[++i]; 271 while((c>='0')&&(c<='9')) { 272 precision = precision*10 + c - '0'; 273 c=fmt[++i]; 274 } 275 276 } 277 278 switch (c = fmt[i++]) { 279 280 /* percentile itself */ 281 case '%': 282 break; 283 284 /* 285 * String and character conversions. 286 */ 287 case 's': 288 print_str(va_arg(ap, char_ptr)); 289 goto loop; 290 291 case 'c': 292 c = (char) va_arg(ap, int); 293 break; 294 295 /* 296 * Hexadecimal conversions with fixed width. 297 */ 298 case 'P': 299 print_str("0x"); 300 case 'p': 301 print_fixed_hex(va_arg(ap, __native), sizeof(__native)); 302 goto loop; 303 304 case 'Q': 305 print_str("0x"); 306 case 'q': 307 print_fixed_hex(va_arg(ap, __u64), INT64); 308 goto loop; 309 310 case 'L': 311 print_str("0x"); 312 case 'l': 313 print_fixed_hex(va_arg(ap, __native), INT32); 314 goto loop; 315 316 case 'W': 317 print_str("0x"); 318 case 'w': 319 print_fixed_hex(va_arg(ap, __native), INT16); 320 goto loop; 321 322 case 'B': 323 print_str("0x"); 324 case 'b': 325 print_fixed_hex(va_arg(ap, __native), INT8); 326 goto loop; 327 328 /* 329 * Floating point conversions. 330 */ 287 switch (c = fmt[i++]) { 288 289 /* percentile itself */ 290 case '%': 291 break; 292 293 /* 294 * String and character conversions. 295 */ 296 case 's': 297 print_str(va_arg(ap, char_ptr)); 298 goto loop; 299 300 case 'c': 301 c = (char) va_arg(ap, int); 302 break; 303 304 /* 305 * Hexadecimal conversions with fixed width. 306 */ 307 case 'P': 308 print_str("0x"); 309 case 'p': 310 print_fixed_hex(va_arg(ap, __native), sizeof(__native)); 311 goto loop; 312 313 case 'Q': 314 print_str("0x"); 315 case 'q': 316 print_fixed_hex(va_arg(ap, __u64), INT64); 317 goto loop; 318 319 case 'L': 320 print_str("0x"); 321 case 'l': 322 print_fixed_hex(va_arg(ap, __native), INT32); 323 goto loop; 324 325 case 'W': 326 print_str("0x"); 327 case 'w': 328 print_fixed_hex(va_arg(ap, __native), INT16); 329 goto loop; 330 331 case 'B': 332 print_str("0x"); 333 case 'b': 334 print_fixed_hex(va_arg(ap, __native), INT8); 335 goto loop; 336 337 /* 338 * Floating point conversions. 339 */ 340 case 'F': 341 print_double(va_arg(ap, double),'F',precision); 342 goto loop; 343 344 case 'f': 345 print_double(va_arg(ap, double),'f',precision); 346 goto loop; 331 347 332 case 'F': 333 print_double(va_arg(ap, double),'F',precision); 334 goto loop; 335 336 case 'f': 337 print_double(va_arg(ap, double),'f',precision); 338 goto loop; 348 case 'E': 349 print_double(va_arg(ap, double),'E',precision); 350 goto loop; 351 case 'e': 352 print_double(va_arg(ap, double),'e',precision); 353 goto loop; 339 354 340 case 'E': 341 print_double(va_arg(ap, double),'E',precision); 342 goto loop; 343 case 'e': 344 print_double(va_arg(ap, double),'e',precision); 345 goto loop; 346 347 /* 348 * Decimal and hexadecimal conversions. 349 */ 350 case 'd': 351 print_number(va_arg(ap, __native), 10); 352 goto loop; 353 354 case 'X': 355 print_str("0x"); 356 case 'x': 357 print_number(va_arg(ap, __native), 16); 358 goto loop; 355 /* 356 * Decimal and hexadecimal conversions. 357 */ 358 case 'd': 359 print_number(va_arg(ap, __native), 10); 360 goto loop; 361 362 case 'X': 363 print_str("0x"); 364 case 'x': 365 print_number(va_arg(ap, __native), 16); 366 goto loop; 359 367 360 361 362 363 364 365 368 /* 369 * Bad formatting. 370 */ 371 default: 372 goto out; 373 } 366 374 367 375 default: putchar(c);
Note:
See TracChangeset
for help on using the changeset viewer.