How to port the driver under PB to BSP? (Take the 2410sd card driver as an example)

Source: Internet
Author: User

Author: wogoyixikexie @ gliet

Previously, I heard from my friends about porting drivers under PB to BSP, and even the file system to BSP. -- Haha, It's very advanced. Now I will take the SD card of 2410 as an example.

Previously I did not know that the SD card driver would be in the Pb installation file. Let's take a look at the following three posts-2410 large-capacity SD card research.

Http://topic.csdn.net/u/20080911/16/111a849c-fd1f-4955-840d-6ddfba8ee1fa.html

Http://topic.csdn.net/u/20080916/16/00d9a2be-e4f8-4bea-b892-f25e20ac4c83.html

Http://topic.csdn.net/u/20081021/10/52df6b8b-c69b-4e7b-a278-0816e133f881.html

Http://topic.csdn.net/u/20081104/13/5024b712-07f4-4b33-a015-f2d5baafa027.html

---- To be continued ..................

++, Continue ....................................... .....................

I have read the sources file in C:/wince500/public/common/oak/CSP/ARM/Samsung/S3C2410X/sdhc.

A strange problem was found, that is, it did not appearReleasetype

 

  1. ! If 0
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. ! Endif
  4. ! If 0
  5. Use of this source code is subject to the terms of the Microsoft end-user
  6. License Agreement (EULA) under which you licensed this software product.
  7. If you did not accept the terms of the EULA, you are not authorized to use
  8. This source code. For a copy of the EULA, please see the license. rtf on your
  9. Install media.
  10. ! Endif
  11. Synchronize_drain = 1
  12. Targetdefname = sdhc_sc2410
  13. Deffile = $ (targetdefname). Def
  14. Targetname = $ (targetdefname) _ lib
  15. Targettype = library
  16. Wincetargetfile0 = $ (_ commonoakroot)/lib/$ (_ cpuindpath)/$ (deffile)
  17. Preprocessdeffile = 1
  18. Sourcelibs = $ (_ commonoakroot)/lib/$ (_ cpuindpath)/sc2410_sdhcbase.lib
  19. Using DES = ../sdhcbase;.../../INC
  20. Sources = sdiocontroller. CPP/

Releasetype:

Releasetype: This macro sets two environment variables: releasedir and releaselibdir, which are the paths for storing the generated files after compilation. The specific values are as follows:

PlatformThe generated file is in platform/<BSP Name>/<target>

LocalThe generated file is in the current path.

CustomThe generated file is located at the specified location in targetpath.

ManagedThe generated file is in % _ projectroot %/oak/<target>/managed

Oak, SDK, DDKThe generated file is in % _ projectroot %/oak/<target>

------ No, so where is the generated lib stored?

The amazing thing is that I found the Lib generated by C:/wince500/public/common/oak/lib/armv4i/retail.

-- Where exactly is it specified that the generated lib will be placed in the above path?

In addition, Microsoft's code is strange, that is, they all specify to generate Lib in sources, but at last they unknowingly generate DLL. How can this be implemented?

Even the PXA Series

  1. ! If 0
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. ! Endif
  4. ! If 0
  5. Use of this source code is subject to the terms of the Microsoft end-user
  6. License Agreement (EULA) under which you licensed this software product.
  7. If you did not accept the terms of the EULA, you are not authorized to use
  8. This source code. For a copy of the EULA, please see the license. rtf on your
  9. Install media.
  10. ! Endif
  11. Targetname = pxa27x_sdhc
  12. Targettype = library
  13. Using DES = ../INC; ../xllp/INC
  14. Sources = Main. c/
  15. Sdcontrol. c

 

There is no releasetype shown above ?!!!!!!!!!!!!!!!!!!!!

--------------------------------------------

But the strange thing is that some drivers specify

C:/wince500/public/common/oak/CSP/ARM/Samsung/S3C2410X/serial/sources (13): releasetype = oak

------------------------

! If 0
Copyright (c) Microsoft Corporation. All rights reserved.
! Endif
! If 0
Use of this source code is subject to the terms of the Microsoft end-user
License Agreement (EULA) under which you licensed this software product.
If you did not accept the terms of the EULA, you are not authorized to use
This source code. For a copy of the EULA, please see the license. rtf on your
Install media.
! Endif

Targetname = s3c2410x_serial
Releasetype = oak
Targettype = library

Supported des = ../INC

Cdefines = $ (cdefines)-duse_new_serial_model

Sources = pdds3c2410_ser.cpp
++ ++

How can this happen? At what stage does Microsoft Convert this lib into a DLL?

In addition, what is the case if no releasetype exists above? I have to make it happen !!!!!!!!!!!!!

-- Done.

Summary: directly copy the entire driver folder to BSP, modify files such as sources, and set releasetype to platform to indicate that the driver is BSP, And the generated dll will be copied to the specified region, by the way, change the generated lib to the generated DLL file name, and change the generated DLL file name to prevent conflicts with Microsoft (some people say it will overwrite Microsoft, which is not confirmed, maybe we should do an experiment .) Then, modify the reg and bib files according to the preceding settings.

Reprinted please indicate: The author wogoyixikexie @ gliet. Guilin University of Electronic Science and Technology Department 1 Association of Science and Technology, original address: Workshop.

 

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.