[Original] oal, a series of summary questions about the wince OS development interview

Source: Internet
Author: User

Next, let's continue to summarize the questions we encountered during the interview yesterday. First, let's take a non-technical question that we encountered during the interview as a refreshing use. The Quick answer should not exceed 5 minutes.

Q0: How can I create a 5-litre water tank and a 3-litre water tank?

Bytes -------------------------------------------------------------------------------------------------------------

Yesterday we talked about bootloader. In fact, we know that the relationship between Bootloader and the wince system is not very big. In the wince operating system, the oal function set is used for initialization, here we need to differentiate the concepts of the oal layer and the oal function set. The oal Development discussed here is centered around the oal function set. First, we will introduce two problems.

Q1: What is oal?
A1: oal (OEM Adaptation Layer) OEM adaptation layer. Another concept is pqoal (product quality level oal), but we generally say oal is enough. The concept is logically resident between Windows Kernel and hardware of the target device.CodeLayer, which is physically linked to the kernel library to generate kernel executable files. Alternatively, oal is the driver of the core hardware on the hardware platform based on the wince operating system.Program, The maximum set of all device drivers;

Q2: What does oal do?
A2: oal mainly does the following: 1. startup function, 2. serial Port debugging, 3. oeminit initialization, 4. system timer, 5. interrupt handling, 6. kernel Input and Output, 7 and kitl (Optional). That is to say, after the oal starts to run to kernlinit from the startup function, the entire wince operating system starts to operate;

Here, we will introduce the cacheable and uncachable problems, which mainly involve MMU and some speed issues. At this stage, MMU still needs to work, and the read/write of memory is related to the cache. Therefore, we must propose the concepts of cache and MMU for everyone to prepare, two more questions are given below.

Q3: What is cache? What is MMU?
A3: cache: a high-speed memory that is very close to the CPU. It is used to store data that is not constantly changing and increase the speed. It is not suitable for enabling frequently changed data. Otherwise, the efficiency will be lower. For example, we cannot use the cached address when accessing gpio. This is the reason. It is often replaced and the efficiency is very low. (This is also an important indicator of the CPU of our PC)
MMU: it is used in multi-task operating systems to provide independent virtual address space for each task. Its implementation principle is to store data such as page tables in the primary storage and map them to the CPU through MMU, then, the CPU can use virtual addresses to schedule tasks and access peripherals. The ing between virtual addresses and physical addresses is fixed, so that the operating system is secure and stable.

Q4: What is the difference between cacheable and uncacheable?
A4: the cache can greatly improve the memory read/write speed. The cache attribute is to use the cache function to read and write this part of the virtual address. That is to say, the virtual memory in this part is cacheable, and vice versa, if it is set to the Uncached attribute, it indicates that the virtual address read/write is not applicable to the cache, that is, the uncacheable. In fact, the difference between the two is whether the cache is used when the virtual address exists;

Q5: Why does cacheable sometimes work with uncacheable? (Don't worry about this problem, that is, some examiners like to ask this question)
A5: this is because cacheable uses virtual memory rain cache. Of course, the speed is improved, but the problem is, memory, especially the I/O port, may cause unpredictable Data Reading and Writing. Therefore, the uncache part of static ing virtual memory is suspended in the operating system kernel;

If you want to learn more about cache and MMU, refer to the following link:
Http://topic.csdn.net/u/20081231/10/BBDE79C2-2884-48E3-9718-90D7FCC1AFA8.html
Http://so.csdn.net/BlogSearchResult.aspx? Q = cache % 20 Username: gooogleman
By: gooogleman

Next, let's continue to look at what our OAL will ask in the next step. The next important step is to stop. First, please read the hjb introduction to the wince interruption.ArticleI have already turned around for countless times, which is very simple and easy to understand. I will not talk about it here. You can read the article directly, after reading the questions we have come to answer several questions during the interview, what will happen next... View by yourself.
Http://www.cnblogs.com/we-hjb/archive/2009/05/26/1490461.html by: hjb

Q6: What is ISR? What is ist?
A6: interrupt service routine (ISR): a low-level processing program in the kernel. It is called first when the interrupt occurs. Interrupt service thread (IST): the Interrupt Processing thread in the drive or application, which is scheduled by the system to complete most of the interrupt processing work.

Q7: What is MDD? What is PDD? The specific example of how to start the work of ist.
A7: MDD is the abbreviation of Model Device Driver. It abstracts the driver code that is common to a certain type of peripherals and suitable for any hardware platform. PDD is the abbreviation of platform dependent driver, it is the driver code that reflects the features of a peripheral on a specific hardware platform. Ist runs in the following situations: 1. in the init function of MDD, 2. when the mdd open function is executed for the first time, 3. PDD;

Q8: What is the first parameter of the waitforsingleobject function? Describe its functions (don't feel disgusting, I didn't answer it. It's really hard to think about it, and it's usually quite smooth)
A8: DWORD waitforsingleobject (handle hhandle, DWORD dwmilliseconds). Its function is to wait for the object specified by the hhandle parameter to be triggered or the time specified by the dwmilliseconds parameter to reach. hhandle can be an event and mutex, semaphores, processes, and threads;

Next we will talk about the clock, ptoc, kitl and config. bib files. I have not met the first three items during the interview, but I have passed the test. The last one is the interview. It is also very simple to ask, view the config. all bib files should be able to answer the question. Now, I have finished reading the last few questions. Haha.

Q9: Why do I use 32768hz as the RTC clock?
A9: 32768 is exactly 32 times of 1024, that is to say, it is a multiple of the 10th power of 2. It is a good algorithm and an integer for easy operation;

Q10: What is TOC? How to view the binfile?
A10: TOC (table of content) is a list of content stored in NAND Flash. It stores storage information about startup and system kernel, block1 to be written in NAND Flash is read by the nboot function. Then nboot configures and redirects to different addresses according to the read content. There will be a specific part in the binfile to describe the location of TOC. How to check it? You only need to enter the command line status in the compiling environment of wince, and then enter viewbin-toc NK. bin> output.txt to view the bin content and print out the TOC content. Very convenient;

Q11: What is kitl?
A11: kitl is short for Kernel independent transport layer. It is used to assist in driver debugging;

Q12: Have you seen config. bib? What does it look like? (At that time, the examiner asked me this question... Okay .)
A12: directly give a config. bib to see:

1:;
 
2:; Copyright (c) Microsoft Corporation. All rights reserved.
 
3:;
 
4:;
 
5:; UseThisSample source codeIsSubject to the terms of the Microsoft
 
6:; License agreement under which you licensedThisSample source code. If
 
7:; You did not accept the terms of the license agreement, you are not
 
8:; Authorized to useThisSample Source Code. For the terms of the license,
9:; Please see the license agreement between you and Microsoft or,IfApplicable,
 
10:; See the license. rtf on your install media or the root of your tools installation.
 
11:; The sample source code is provided"As is", With no warranties.
 
12:;
 
13: 
 
14:Memory;Defines the settings for memory allocation, which are generally in the config. bib file in BSP.
 
15: 
 
16:;
 
17:; NK and ram region definitions.
18:;
 
19:If imgflash!
 
20:# DefineNkname NK
 
21:# DefineNkstart 80070000
 
22:# DefineNklen 02000000
 
23: 
 
24:# DefineRamname Ram
 
25:# DefineRam 82070000
 
26:# DefineRamlen 01e7f000
 
27: 
28:Else
 
29: 
 
30:# DefineNkname NK
 
31:# DefineNkstart 88001000
 
32:# DefineNklen 05fff000// 96 MB less 4 K
 
33: 
 
34:# DefineRamname Ram
 
35:# DefineRam 80070000
 
36:# DefineRamlen 03e7f000
37: 
 
38:Endif; imgflash
 
39: 
 
40:PTS 80000000 00020000 Reserved
 
41:ARGs 80020000 00000800 Reserved
 
42:Sleepstate 80020800 00000800 Reserved
 
43:Eboot 80021000 00040000 Reserved
 
44:Eboot_stack 80061000 00004000 Reserved
 
45:Eboot_ram 80065000 00006000 Reserved
 
46: 
47:$ (Nkname) $ (nkstart) $ (nklen) ramimage
 
48:$ (Ramname) $ (ramstart) $ (ramlen) RAM
 
49:
 
50:Efsbuf 83eef000 00011000 Reserved
 
51:Display 83f00000100000 Reserved
 
52: 
 
53:; For Windows CE, reserve flash onlyIfImgflash = 1
 
54:; For Windows Mobile, always reserve it,ForImgfs
 
55:If imgflash!
56:Flash 88000000 06000000 Reserved
 
57:Endif ;! Imgflash
 
58:If imgflash
 
59:If imgtpc
 
60:Flash 88000000 06000000 Reserved
 
61:Endif; imgtpc
 
62:If imgppc
 
63:Flash 88000000 06000000 Reserved
 
64:Endif; imgppc
 
65:Endif; imgflash
66:Eboot_config 880f00000 00010000 Reserved
 
67: 
 
68:; @ Cesysgen if ce_modules_ramfmd
 
69: 
 
70:If img_reserveramfmd
 
71:; SetThisVariable to the size,InBytes, of memory discovered
 
72:; Oemextensiondram to reserveForThe ram FMD persistent Storage
 
73:; Driver. ThisValueMust be a multiple of 4 K. Due to limitations
74:;InThe implementation of ramfmd,This ValueMust be less than or
 
75:; Equal to 32 MB.
 
76:G_dwextensionramfmdsize 00000000 02000000 fixupvar
 
77:Endif; img_reserveramfmd
 
78: 
 
79:; @ Cesysgen endif ce_modules_ramfmd
 
80: 
 
81:; This fix-up variableIsA bitfield that can be used to initialize
82:; The oal debug zones per oal_log.h. uncomment the line and
 
83:; Change the hexidecimal bits to enable the desired zones.
 
84:;Default Value(0x0000000b) enables the oal_log_error,
 
85:; Oal_log_warn, and oal_log_info zones, and will be used
 
86:; OeminitIfThe line remains commentedOut.
 
87:;
 
88:; Nk.exe: initialoallogzones 00000000 0x0000000b fixupvar
 
89: 
90:; This fix-up variable determines the amount of memory the BSP
 
91:; ReservesForWatson dump capture. The currentDefaultBehaviorIs
 
92:;DefaultTo zero unless the image has sysgen_watson_dmpgen
 
93:; Defined.DefaultSizeIs300kib.
 
94:;
 
95:; @ Cesysgen if ce_modules_osaxst0
 
96:Nk.exe: dwoemdrwatsonsize 00000000 0x4b000 fixupvar
97:; @ Cesysgen endif
 
98: 
 

99:The last makeimgstage of the config map provides some configuration attributes for romimage.exe to generate the wince image.
; This option is optional and is generally defined in the config. bib file in BSP.

 
100: 
 
101:; @ Cesysgen if! Nk_nknocomp
 
102:Compression = on
 
103:; @ Cesysgen endif! Nk_nknocomp
 
104:; @ Cesysgen if nk_nknocomp
 
105:Compression = off
 
106:; @ Cesysgen endif nk_nknocomp
107: 
 
108:Kernelfixups = on
 
109: 
 
110:; Multi-region
 
111:;
 
112:If imgflash!
 
113:Autosize = on; autosizeIsUsed to enable the following flags.
 
114:Endif
 
115:Dlladdr_autosize = on
 
116: 
 
117:; Autosize_romgap = 10000
118:; Autosize_dlladdrgap = 0
 
119:; Autosize_dlldataaddrgap = 0
 
120:; Autosize_dllcodeaddrgap = 0
 
121: 
 
122:If imgprofiler
 
123:Profile = on
 
124:Else
 
125:Profile = off
 
126:Endif
 
127: 
 
128:If imgflash
 
129:Romstart = 88000000
130:Romsize = 06000000
 
131:Romwidth = 32
 
132:Endif; imgflash
 
133: 
 
134:;
 
135:; RomflagsIsA bitmask of optionsForThe kernel
 
136:; Romflags 0x0001 disallow Paging
 
137:; Romflags 0x0010 trust module only
 
138:;
 
139:
 
140:If imgtrustromonly
141:Romflags = 10
 
142:Else
 
143:Romflags = 0
 
144:Endif
 
145: 

 

Today, we can see that. The last part of tomorrow is the driver.

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.