?? faqs.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0045)http://ucos-ii.com/contents/support/faqs.html -->
<HTML><HEAD><TITLE>Micrium Support : F.A.Q.</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK
href="faqs.files/white-micrium3.css" type=text/css rel=stylesheet>
<META
content=" Micrium is Empowering Embedded systems via ANSI C source code for RTOS, GUI, File System and TCP/IP stack. Book or manuals documentation format"
name=Description>
<META
content="Embedded Kernel, Embedded Operating System, Real time operating system, RTOS, Embedded Software, Embedded Systems, Kernel, Real Time Kernel, ROMable, RAM, ROM, EPROM, EEPROM, Scalable, Portability, Ports, Microprocessors, Microcontrollers, Context Switching, Task Switch, Task Scheduling, uC/OS, 礐/OS, PEG, Portable Embedded Graphical User Interface, Graphical User Interface, GUI, Embedded GUI, Embedded Graphical Display, LCD Display, Antialiasing, Fonts, Bitmaps, Display, widget, widgets, dialog, dialogs, windows, radio button, check box, scroll bar, slider,edit box, 礐/GUI, uC/GUI, File System, Flash, Loader, 礐/FS product page, Directory, 礐/FlashLoader, Flash, Memory, Load, Loader, Update, Open Source"
name=Keywords>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0"
marginwidth="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD><A name=top></A><IMG height=30 src="faqs.files/title-faqs.gif"
width=540></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=10 width="100%" border=0>
<TBODY>
<TR>
<TD>
<P><BR><A
href="http://ucos-ii.com/contents/support/faqs.html#faq1">FAQ-01:</A>
<B>My computer/processor 'hangs' when I run 礐/OS or 礐/OS-II! </B></P>
<P><A
href="http://ucos-ii.com/contents/support/faqs.html#faq2">FAQ-02:</A>
<B>Are you allowed to send a NULL-pointer through a Mailbox or a
Queue?</B></P>
<P><A
href="http://ucos-ii.com/contents/support/faqs.html#faq3">FAQ-03:</A>
<B>Where should I enable the 'tick' interrupt?</B></P>
<P><A
href="http://ucos-ii.com/contents/support/faqs.html#faq4">FAQ-04:</A>
<B>Does 礐/OS and 礐/OS-II work with Microsoft C/C++?</B></P>
<P><A
href="http://ucos-ii.com/contents/support/faqs.html#faq5">FAQ-05:</A>
<B>Are there other ports available for 礐/OS and 礐/OS-II? </B></P>
<P><A
href="http://ucos-ii.com/contents/support/faqs.html#faq6">FAQ-06</A>:<B>
Is there a better way to implement OSIntCtxSw() and
ISRs?</B><BR>
(Added 2001/01/26) </P>
<P><BR></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title>F<A name=faq1></A>AQ-01: My computer/processor
'hangs' when I run 礐/OS or 礐/OS-II!</TD></TR></TBODY></TABLE>
<P>DOS executables for 礐/OS and 礐/OS-II are provided on the diskette. If
礐/OS (or 礐/OS-II) still hangs with the executable provided on the
floppy, try to contact me at <A
href="mailto:Jean.Labrosse@uCOS-II.com">Jean.Labrosse@uCOS-II.com</A>. If
礐/OS (or 礐/OS-II) does not hang with the executable provided on the
floppy then there are two possible reasons your computer could crash: </P>
<P><B>1)</B> You need to look at <SPAN class=codewiew>OSIntCtxSw</SPAN>
(pages 62, 63 and 67 in the 礐/OS book or pages 200 and 201 in 礐/OS-II)
which is processor and compiler specific. The very first instruction
in <SPAN class=codewiew>OSIntCtxSw()</SPAN> may need some adjustment, i.e.
<SPAN class=codewiew>ADD SP,8</SPAN>. If you use another processor,
compiler or memory model, you may need to adjust the constant.
This section in the book will explain how to determine the 'magic number'
to add to the stack pointer. <BR>The actual value depends on
the compiler used and the compiler options. For example, on the x86
real-mode small model, the constant can be either 4, 6, 8, 10 ...
For the x86 real-mode, large model, the constant can be either 8, 10, 12,
14, 16 ...</P>
<P><B>2)</B> You may want to try removing ANY (and ALL) floating-point
operation. The sample code in example #1 (礐/OS V1.xx and 礐/OS-II
V2.00) has a floating-point operation in the start task. Comment it
out (by putting <SPAN class=codewiew>#if 0 / #endif</SPAN> around the
<SPAN class=codewiew>sprintf()</SPAN> statement) and try compiling and
running the code. If the code works, the crash is due to the fact
that:<BR> a) The Borland C/C++ floating-point library is
non-reentrant.<BR> b) 礐/OS and 礐/OS-II's task stacks
need to be initialized to perform floating-point operations in a reentrant
way. Refer to AN-1001 for details (See <A
href="http://ucos-ii.com/contents/support/appl_notes.html">AppNotes</A>).
</P>
<P><B>3)</B> See <A
href="http://ucos-ii.com/contents/support/faqs.html#faq6">FAQ-06</A>. </P>
<P><A href="http://ucos-ii.com/contents/support/faqs.html#top"><IMG
height=18 alt="Back to top" src="faqs.files/backtotop.gif" width=84
border=0 name=top></A></P>
<P> </P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title>F<A name=faq2></A>AQ-02: Are you allowed to send a
NULL-pointer through a Mailbox or a Queue?</TD></TR></TBODY></TABLE>
<P>No. By definition, a NULL-pointer is not supposed to point to any
valid data. You could, however, 'fake' 礐/OS (or 礐/OS-II) into
sending NULL pointers. You will need to 're-map' a NULL pointer to
another 'invalid' pointer. For example, if you want to send a NULL
through a message mailbox, you can do the following:</P>
<P class=codewiew>void SenderTask (void *pdata)<BR>{<BR>
.<BR> .<BR> if (msg == (void *)0) {
/* Do I want to send a NULL pointer ?
*/<BR> msg = (void *)0xFFFFFFFF;
/* Yes, remap to another 'invalid'
pointer */<BR> }<BR> OSMboxPost(Mbox,
msg);<BR> .<BR> .<BR>}void
ReceiverTask (void *pdata)<BR>{<BR> void
*msg;<BR> .<BR>
.<BR> msg = OSMboxPend(Mbox, 0, &err);
<BR> if (err == OS_NO_ERR)
{<BR> if (msg == (void
*)0xFFFFFFFF) { /* Did I receive a NULL pointer ?
*/<BR>
msg = (void *)0;<BR>
}<BR>
.<BR> .<BR>
}<BR> .<BR> .<BR>} </P>
<P></P>
<P><A href="http://ucos-ii.com/contents/support/faqs.html#top"><IMG
height=18 alt="Back to top" src="faqs.files/backtotop.gif" width=84
border=0 name=top></A></P>
<P class=codewiew> </P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -