Geekos Problems and Solutions

Source: Internet
Author: User

At first, Because bochs configuration is always faulty, a configuration file can be used on another computer, but it cannot be used on another computer. Search for information on the Internet and find that the configuration file of bochs is closely related to the hardware configuration of the physical host, and it is also related to the installation path of bochs. Some computers may need to comment out newharddrivesupport: enabled = 1; some computers may need to comment out

Diskc: file = diskc. IMG, cyl = 40, heads = 8, SPT = 64

Replace with ata0-master: TYPE = disk, mode = flat, Path = diskc. IMG, cylinders = 40, heads = 8, SPT = 64.

Vgaromimage:/usr/share/bochs/vgabios-lgpl-latestromimage: file =/usr/share/bochs/BIOS-bochs-Latest, the path in address = 0xf0000 must be the same as the installation path of bochs. Otherwise, geekos cannot be started.

Worker, check that/project2/build/worker runs successfully.

When project 2 is tested, "failed to read file XXX!" appears when you enter the executable file name !" But the program is still running normally. The execution of the sourceinside tracing program is used to find the process. in C, spawn_with_path first tries to call spawn_program (Finally, sys_spawn and sys_spawn call spwan to execute user programs through def_syscall, when you only enter the name of the executable file, spwan cannot execute the user program. The time slice is not obvious, so "failed to read file XXX!" appears!" Error message. Use the return value of spawn_program to determine whether the user program has been successfully executed. Otherwise, add the path to execute again.

Variables defined in other files must be declared with extern. Otherwise, the compilation fails. When writing a program, you can place the global variable declaration in the header file. Other source files must use this variable to include the corresponding header file, which facilitates program maintenance.

When testing the multi-queue priority scheduling algorithm in project 3, the following problems are frequently encountered:

Figure 1 Project 3 multi-queue priority scheduling test errors

This error is caused by unpredictable interruptions. According to relevant information, it is found that the implementation of geekos call interruption mainly involves two data structures: the Interrupt Descriptor Table s_idt and interrupt processing function table g_interrupttable.s_idt are statically allocated in the kernel. Each descriptor points to lowlevel. macro definition blocks of Interrupt vectors defined in the ASM file, which define calls of 256 interrupt vectors. Where, 0 ~ The 17th interrupt is the Intel CPU interrupt vector, 18 ~ The value 225 is the User-Defined interrupt vector. Geekos initializes most interrupt handler functions as dummy_interrupt_handler, which displays the status of each computer register that was saved at the time of interruption. 12 ~ On the 13th, the CPU interrupt handler function is gpf_handler, and the system calls the syscall_handler interrupt handler function. The keyboard, timer, and other hardware Interruptions also have their own external interrupt handler functions.

The test interrupt occurs on the 39 th. The geekos interrupt processing function prints the relevant information and terminates the system execution. The implementation is as follows:

Static void dummy_interrupt_handler (struct interrupt_state * State)

{

Print ("*** unexpectedinterrupt! * ** \ N ");

Dump_interrupt_state (State );

Stop ();

}. You can annotate the execution of this function, or customize an interrupt processing function.

When the semaphore is implemented, the program is killed and the test fails, as shown in:

Figure 2 project 3 semaphore test errors

The cause of the error is that the semaphore name of the user space is directly used in the kernel space, and the Pointer Points to the wrong address, resulting in page protection interruption. Copy_user_string can be used to copy user space data to kernel space. In addition, pay special attention to the use of strings and pointers. strings are character arrays.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.