ffos : b2g loader main到b2g_main

Firefox OS启动过程分析-b2g进程启动 b2g启动时,运行”/system/b2g/b2g”,入口在”gecko/b2g/app/B2GLoader.cpp”中,如下:int main(int argc, const char* argv[]) { /** * Reserve file descriptors before loading static data. */ FdArray reservedFds; R 阅读详情

fork 之后分两条线,

b2g 进程:

main(b2g process)--> b2g_main--->do_main-->

startup xpcom 的过程:

main()->RunProcesses()->b2g_main()->do_main()->XRE_main->ScopedXPCOMStartup::Initialize()->NS_InitXPCOM2()

 

nuwa/content进程:

main(nuwa process)-->?

 

在b2g process 这边,b2g loader fork 出nuwa后,回收僵尸进程以及调XRE_ProcLoaderClientInit对b2g loader client进行初始化,接着b2g_main启动b2g process ,具体来说就是startthreadpool() 用于binder ipc相关的通信,同时调do_main()-->XRE_main进行后续操作。

b2g_main()的主要作用是启动b2g process,具体如下:

 android::ProcessState::self()->startThreadPool();//binder ipc 相关,线程池,注册主线程

rv = XPCOMGlueLoadXULFunctions(kXULFuncs);//又一次,做

result = do_main(argc, _argv);//主要接着去调XRE_main()


#ifdef MOZ_WIDGET_GONK
    // This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
    // receive binder calls, though not necessary to send binder calls.
    // ProcessState::Self() also needs to be called once on the main thread to
    // register the main thread with the binder driver.
    P_LOGI("call startThreadPool--->");
    android::ProcessState::self()->startThreadPool();
#endif

 

在b2g process 中:

do_main()只做了以下事情:

mozilla::StartBootAnimation();//开机动画

return XRE_main(argc, argv, &sAppData, 0);//继续XRE_

 

XRE_main()做了哪些事情呢???

做了非常多的核心工作,


XRE_main (int argc, char *argv[], const nsXREAppData *aAppData)
{

  int result = XRE_mainInit(&exit);
  result = XRE_mainStartup(&exit);
  mScopedXPCOM = MakeUnique<ScopedXPCOMStartup>();
  rv = mScopedXPCOM->Initialize();
  rv = XRE_mainRun();

}

 

(1)XRE_maininit()  检查appdata override 及其正确性,获取其二进制文件地址??配置crashreporter 的属性等

(2)XRE_mainStartup()检查版本 ,兼容性,setprofile ,检查gecko更新?,GTK初始化,crashreporter崩溃报告等

(3)mScopedXPCOM->Initialize() 初始化xpcom,
  (4) XRE_mainRun() 去跑gecko app

 

MakeUnique ≈ new

mScopedXPCOM = MakeUnique<ScopedXPCOMStartup>();

new ScopedXPCOMStartup;

 


/**
 * MakeUnique is a helper function for allocating new'd objects and arrays,
 * returning a UniquePtr containing the resulting pointer.  The semantics of
 * MakeUnique<Type>(...) are as follows.
 *
 *   If Type is an array T[n]:
 *     Disallowed, deleted, no overload for you!
 *   If Type is an array T[]:
 *     MakeUnique<T[]>(size_t) is the only valid overload.  The pointer returned
 *     is as if by |new T[n]()|, which value-initializes each element.  (If T
 *     isn't a class type, this will zero each element.  If T is a class type,
 *     then roughly speaking, each element will be constructed using its default
 *     constructor.  See C++11 [dcl.init]p7 for the full gory details.)
 *   If Type is non-array T:
 *     The arguments passed to MakeUnique<T>(...) are forwarded into a
 *     |new T(...)| call, initializing the T as would happen if executing
 *     |T(...)|.
 *
 * There are various benefits to using MakeUnique instead of |new| expressions.
 *
 * First, MakeUnique eliminates use of |new| from code entirely.  If objects are
 * only created through UniquePtr, then (assuming all explicit release() calls
 * are safe, including transitively, and no type-safety casting funniness)
 * correctly maintained ownership of the UniquePtr guarantees no leaks are
 * possible.  (This pays off best if a class is only ever created through a
 * factory method on the class, using a private constructor.)
 *
 * Second, initializing a UniquePtr using a |new| expression requires repeating
 * the name of the new'd type, whereas MakeUnique in concert with the |auto|
 * keyword names it only once:
 *
 *   UniquePtr<char> ptr1(new char()); // repetitive
 *   auto ptr2 = MakeUnique<char>();   // shorter
 *
 * Of course this assumes the reader understands the operation MakeUnique
 * performs.  In the long run this is probably a reasonable assumption.  In the
 * short run you'll have to use your judgment about what readers can be expected
 * to know, or to quickly look up.
 *
 * Third, a call to MakeUnique can be assigned directly to a UniquePtr.  In
 * contrast you can't assign a pointer into a UniquePtr without using the
 * cumbersome reset().
 *
 *   UniquePtr<char> p;
 *   p = new char;           // ERROR
 *   p.reset(new char);      // works, but fugly
 *   p = MakeUnique<char>(); // preferred
 *
 * (And third, although not relevant to Mozilla: MakeUnique is exception-safe.
 * An exception thrown after |new T| succeeds will leak that memory, unless the
 * pointer is assigned to an object that will manage its ownership.  UniquePtr
 * ably serves this function.)
 */

template<typename T, typename... Args>
typename detail::UniqueSelector<T>::SingleObject
MakeUnique(Args&&... aArgs)
{
  return UniquePtr<T>(new T(Forward<Args>(aArgs)...));
}

template<typename T>
typename detail::UniqueSelector<T>::UnknownBound
MakeUnique(decltype(sizeof(int)) aN)
{
  typedef typename RemoveExtent<T>::Type ArrayType;
  return UniquePtr<T>(new ArrayType[aN]());
}

template<typename T, typename... Args>
typename detail::UniqueSelector<T>::KnownBound
MakeUnique(Args&&... aArgs) = delete;

} // namespace mozilla

new ScopedXPCOMStartup

nsIServiceManager* mServiceManager;


/**
 * Because we're starting/stopping XPCOM several times in different scenarios,
 * this class is a stack-based critter that makes sure that XPCOM is shut down
 * during early returns.
 */

class ScopedXPCOMStartup
{
public:
  ScopedXPCOMStartup() :
    mServiceManager(nullptr) { }
  ~ScopedXPCOMStartup();

  nsresult Initialize();
  nsresult SetWindowCreator(nsINativeAppSupport* native);

  static nsresult CreateAppSupport(nsISupports* aOuter, REFNSIID aIID, void** aResult);

private:
  nsIServiceManager* mServiceManager;
  static nsINativeAppSupport* gNativeAppSupport;
};

 

ScopedXPCOMStartup::initialize()

rv = NS_InitXPCOM2(&mServiceManager, gDirServiceProvider->GetAppDir(),gDirServiceProvider);//初始化,获取相关xpcom 服务

nsCOMPtr<nsIComponentRegistrar> reg =  do_QueryInterface(mServiceManager);//获取intrface (from xpt?)
 


NSMODULE_DEFN(Apprunner) = &kXREModule;

nsresult
ScopedXPCOMStartup::Initialize()
{
  NS_ASSERTION(gDirServiceProvider, "Should not get here!");

  nsresult rv;

  rv = NS_InitXPCOM2(&mServiceManager, gDirServiceProvider->GetAppDir(),
                     gDirServiceProvider);
  if (NS_FAILED(rv)) {
    NS_ERROR("Couldn't start xpcom!");
    mServiceManager = nullptr;
  }
  else {
    nsCOMPtr<nsIComponentRegistrar> reg =
      do_QueryInterface(mServiceManager);
    NS_ASSERTION(reg, "Service Manager doesn't QI to Registrar.");
  }

  return rv;
}

关于mServiceManager:

gecko/xpcom/components/nsIServiceManager.idl

nsIServiceManager* mServiceManager;

###gecko/xpcom/components/nsIServiceManager.idl

#include "nsISupports.idl"

/**
 * The nsIServiceManager manager interface provides a means to obtain
 * global services in an application. The service manager depends on the 
 * repository to find and instantiate factories to obtain services.
 *
 * Users of the service manager must first obtain a pointer to the global
 * service manager by calling NS_GetServiceManager. After that, 
 * they can request specific services by calling GetService. When they are
 * finished they can NS_RELEASE() the service as usual.
 *
 * A user of a service may keep references to particular services indefinitely
 * and only must call Release when it shuts down.
 */

[scriptable, uuid(8bb35ed9-e332-462d-9155-4a002ab5c958)]
interface nsIServiceManager : nsISupports
{
    /**
     * getServiceByContractID
     *
     * Returns the instance that implements aClass or aContractID and the
     * interface aIID.  This may result in the instance being created.
     *
     * @param aClass or aContractID : aClass or aContractID of object 
     *                                instance requested
     * @param aIID : IID of interface requested
     * @param result : resulting service 
     */
    void getService(in nsCIDRef aClass, 
		    in nsIIDRef aIID, 
		    [iid_is(aIID),retval] out nsQIResult result);

    void getServiceByContractID(in string aContractID,
				in nsIIDRef aIID, 
				[iid_is(aIID),retval] out nsQIResult result);

    /**
     * isServiceInstantiated
     *
     * isServiceInstantiated will return a true if the service has already
     * been created, or throw otherwise
     *
     * @param aClass or aContractID : aClass or aContractID of object 
     *                                instance requested
     * @param aIID : IID of interface requested
     * @throws NS_ERROR_SERVICE_NOT_AVAILABLE if the service hasn't been 
     *         instantiated
     * @throws NS_NOINTERFACE if the IID given isn't supported by the object
     */
    boolean isServiceInstantiated(in nsCIDRef aClass, in nsIIDRef aIID);
    boolean isServiceInstantiatedByContractID(in string aContractID, in nsIIDRef aIID);
};


%{C++
// Observing xpcom autoregistration.  Topics will be 'start' and 'stop'.
#define NS_XPCOM_AUTOREGISTRATION_OBSERVER_ID "xpcom-autoregistration"

#ifdef MOZILLA_INTERNAL_API
#include "nsXPCOM.h"
#include "nsComponentManagerUtils.h"
#include "nsServiceManagerUtils.h"
#endif
%}

rv = NS_InitXPCOM2(&mServiceManager, gDirServiceProvider->GetAppDir(),gDirServiceProvider);

NS_InitXPCOM2()

gecko/xpcom/build/XPCOMInit.cpp


EXPORT_XPCOM_API(nsresult)
NS_InitXPCOM(nsIServiceManager** aResult,
             nsIFile* aBinDirectory)
{
  return NS_InitXPCOM2(aResult, aBinDirectory, nullptr);
}


...

// Note that on OSX, aBinDirectory will point to .app/Contents/Resources/browser
EXPORT_XPCOM_API(nsresult)
NS_InitXPCOM2(nsIServiceManager** aResult,
              nsIFile* aBinDirectory,
              nsIDirectoryServiceProvider* aAppFileLocationProvider)
{
  static bool sInitialized = false;
  if (sInitialized) {
    return NS_ERROR_FAILURE;
  }

  sInitialized = true;

  mozPoisonValueInit();

  NS_LogInit();

  mozilla::LogModule::Init();

  JS_SetCurrentEmbedderTimeFunction(TimeSinceProcessCreation);

  char aLocal;
  profiler_init(&aLocal);
  nsresult rv = NS_OK;

  // We are not shutting down
  gXPCOMShuttingDown = false;

  // Initialize the available memory tracker before other threads have had a
  // chance to start up, because the initialization is not thread-safe.
  mozilla::AvailableMemoryTracker::Init();

#ifdef XP_UNIX
  // Discover the current value of the umask, and save it where
  // nsSystemInfo::Init can retrieve it when necessary.  There is no way
  // to read the umask without changing it, and the setting is process-
  // global, so this must be done while we are still single-threaded; the
  // nsSystemInfo object is typically created much later, when some piece
  // of chrome JS wants it.  The system call is specified as unable to fail.
  nsSystemInfo::gUserUmask = ::umask(0777);
  ::umask(nsSystemInfo::gUserUmask);
#endif

  // Set up chromium libs
  NS_ASSERTION(!sExitManager && !sMessageLoop, "Bad logic!");

  if (!AtExitManager::AlreadyRegistered()) {
    sExitManager = new AtExitManager();
  }

  if (!MessageLoop::current()) {
    sMessageLoop = new MessageLoopForUI(MessageLoop::TYPE_MOZILLA_UI);
    sMessageLoop->set_thread_name("Gecko");
    // Set experimental values for main thread hangs:
    // 128ms for transient hangs and 8192ms for permanent hangs
    sMessageLoop->set_hang_timeouts(128, 8192);
  }

  if (XRE_IsParentProcess() &&
      !BrowserProcessSubThread::GetMessageLoop(BrowserProcessSubThread::IO)) {
    UniquePtr<BrowserProcessSubThread> ioThread = MakeUnique<BrowserProcessSubThread>(BrowserProcessSubThread::IO);

    base::Thread::Options options;
    options.message_loop_type = MessageLoop::TYPE_IO;
    if (NS_WARN_IF(!ioThread->StartWithOptions(options))) {
      return NS_ERROR_FAILURE;
    }

    sIOThread = ioThread.release();
  }

  // Establish the main thread here.
  rv = nsThreadManager::get()->Init();
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return rv;
  }

  // Set up the timer globals/timer thread
  rv = nsTimerImpl::Startup();
  if (NS_WARN_IF(NS_FAILED(rv))) {
    return rv;
  }

#ifndef ANDROID
  // If the locale hasn't already been setup by our embedder,
  // get us out of the "C" locale and into the system
  if (strcmp(setlocale(LC_ALL, nullptr), "C") == 0) {
    setlocale(LC_ALL, "");
  }
#endif

#if defined(XP_UNIX)
  NS_StartupNativeCharsetUtils();
#endif

  NS_StartupLocalFile();

  StartupSpecialSystemDirectory();

  nsDirectoryService::RealInit();

  bool value;

  if (aBinDirectory) {
    rv = aBinDirectory->IsDirectory(&value);

    if (NS_SUCCEEDED(rv) && value) {
      nsDirectoryService::gService->Set(NS_XPCOM_INIT_CURRENT_PROCESS_DIR,
                                        aBinDirectory);
    }
  }

  if (aAppFileLocationProvider) {
    rv = nsDirectoryService::gService->RegisterProvider(aAppFileLocationProvider);
    if (NS_FAILED(rv)) {
      return rv;
    }
  }

  nsCOMPtr<nsIFile> xpcomLib;
  nsDirectoryService::gService->Get(NS_GRE_BIN_DIR,
                                    NS_GET_IID(nsIFile),
                                    getter_AddRefs(xpcomLib));
  MOZ_ASSERT(xpcomLib);

  // set gGREBinPath
  nsAutoString path;
  xpcomLib->GetPath(path);
  gGREBinPath = ToNewUnicode(path);

  xpcomLib->AppendNative(nsDependentCString(XPCOM_DLL));
  nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);

  if (!mozilla::Omnijar::IsInitialized()) {
    mozilla::Omnijar::Init();
  }

  if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
#ifdef OS_WIN
    CommandLine::Init(0, nullptr);
#else
    nsCOMPtr<nsIFile> binaryFile;
    nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
                                      NS_GET_IID(nsIFile),
                                      getter_AddRefs(binaryFile));
    if (NS_WARN_IF(!binaryFile)) {
      return NS_ERROR_FAILURE;
    }

    rv = binaryFile->AppendNative(NS_LITERAL_CSTRING("nonexistent-executable"));
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }

    nsCString binaryPath;
    rv = binaryFile->GetNativePath(binaryPath);
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }

    static char const* const argv = { strdup(binaryPath.get()) };
    CommandLine::Init(1, &argv);
#endif
  }

  NS_ASSERTION(nsComponentManagerImpl::gComponentManager == nullptr,
               "CompMgr not null at init");

  // Create the Component/Service Manager
  nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl();
  NS_ADDREF(nsComponentManagerImpl::gComponentManager);

  // Global cycle collector initialization.
  if (!nsCycleCollector_init()) {
    return NS_ERROR_UNEXPECTED;
  }

  // And start it up for this thread too.
  nsCycleCollector_startup();

  // Register ICU memory functions.  This really shouldn't be necessary: the
  // JS engine should do this on its own inside JS_Init, and memory-reporting
  // code should call a JSAPI function to observe ICU memory usage.  But we
  // can't define the alloc/free functions in the JS engine, because it can't
  // depend on the XPCOM-based memory reporting goop.  So for now, we have
  // this oddness.
  mozilla::SetICUMemoryFunctions();

  // Do the same for libogg.
  ogg_set_mem_functions(OggReporter::CountingMalloc,
                        OggReporter::CountingCalloc,
                        OggReporter::CountingRealloc,
                        OggReporter::CountingFree);

#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
  // And for VPX.
  vpx_mem_set_functions(VPXReporter::CountingMalloc,
                        VPXReporter::CountingCalloc,
                        VPXReporter::CountingRealloc,
                        VPXReporter::CountingFree,
                        memcpy,
                        memset,
                        memmove);
#endif

#ifdef MOZ_WEBM
  // And for libnestegg.
  // libnestegg expects that its realloc implementation will free
  // the pointer argument when a size of 0 is passed in, so we need
  // the special version of the counting realloc.
  nestegg_set_halloc_func(NesteggReporter::CountingFreeingRealloc);
#endif

  // Initialize the JS engine.
  if (!JS_Init()) {
    NS_RUNTIMEABORT("JS_Init failed");
  }

  rv = nsComponentManagerImpl::gComponentManager->Init();
  if (NS_FAILED(rv)) {
    NS_RELEASE(nsComponentManagerImpl::gComponentManager);
    return rv;
  }

  if (aResult) {
    NS_ADDREF(*aResult = nsComponentManagerImpl::gComponentManager);
  }

  // The iimanager constructor searches and registers XPT files.
  // (We trigger the singleton's lazy construction here to make that happen.)
  (void)XPTInterfaceInfoManager::GetSingleton();

  // After autoreg, but before we actually instantiate any components,
  // add any services listed in the "xpcom-directory-providers" category
  // to the directory service.
  nsDirectoryService::gService->RegisterCategoryProviders();

  // Init SharedThreadPool (which needs the service manager).
  SharedThreadPool::InitStatics();

  // Init AbstractThread.
  AbstractThread::InitStatics();

  // Force layout to spin up so that nsContentUtils is available for cx stack
  // munging.
  nsCOMPtr<nsISupports> componentLoader =
    do_GetService("@mozilla.org/moz/jsloader;1");

  mozilla::scache::StartupCache::GetSingleton();
  mozilla::AvailableMemoryTracker::Activate();

  // Notify observers of xpcom autoregistration start
  NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY,
                                nullptr,
                                NS_XPCOM_STARTUP_OBSERVER_ID);
#ifdef XP_WIN
  CreateAnonTempFileRemover();
#endif

  // We only want the SystemMemoryReporter running in one process, because it
  // profiles the entire system.  The main process is the obvious place for
  // it.
  if (XRE_IsParentProcess()) {
    mozilla::SystemMemoryReporter::Init();
  }

  // The memory reporter manager is up and running -- register our reporters.
  RegisterStrongMemoryReporter(new ICUReporter());
  RegisterStrongMemoryReporter(new OggReporter());
#ifdef MOZ_VPX
  RegisterStrongMemoryReporter(new VPXReporter());
#endif
#ifdef MOZ_WEBM
  RegisterStrongMemoryReporter(new NesteggReporter());
#endif

  mozilla::Telemetry::Init();

  mozilla::HangMonitor::Startup();
  mozilla::BackgroundHangMonitor::Startup();

  const MessageLoop* const loop = MessageLoop::current();
  sMainHangMonitor = new mozilla::BackgroundHangMonitor(
    loop->thread_name().c_str(),
    loop->transient_hang_timeout(),
    loop->permanent_hang_timeout());

  return NS_OK;
}


//
// NS_ShutdownXPCOM()
//
// The shutdown sequence for xpcom would be
//
// - Notify "xpcom-shutdown" for modules to release primary (root) references
// - Shutdown XPCOM timers
// - Notify "xpcom-shutdown-threads" for thread joins
// - Shutdown the event queues
// - Release the Global Service Manager
//   - Release all service instances held by the global service manager
//   - Release the Global Service Manager itself
// - Release the Component Manager
//   - Release all factories cached by the Component Manager
//   - Notify module loaders to shut down
//   - Unload Libraries
//   - Release Contractid Cache held by Component Manager
//   - Release dll abstraction held by Component Manager
//   - Release the Registry held by Component Manager
//   - Finally, release the component manager itself
//
EXPORT_XPCOM_API(nsresult)
NS_ShutdownXPCOM(nsIServiceManager* aServMgr)
{
  return mozilla::ShutdownXPCOM(aServMgr);
}

xpcom Init 主要包含如下调用:

EXPORT_XPCOM_API(nsresult)
NS_InitXPCOM2(nsIServiceManager** aResult,
              nsIFile* aBinDirectory,
              nsIDirectoryServiceProvider* aAppFileLocationProvider)
{
mozPoisonValueInit()
    NS_LogInit()
    Init()
    JS_SetCurrentEmbedderTimeFunction()
    profiler_init()
    umask()
    AtExitManager()
    AlreadyRegistered()
    current()
    MessageLoopForUI()
    XRE_IsParentProcess()
    GetMessageLoop()
    Startup()
    setlocale()
    NS_StartupNativeCharsetUtils()
    NS_StartupLocalFile()
    StartupSpecialSystemDirectory()
    RealInit()
    NS_GET_IID()
    nsDependentCString()
    IsInitialized()
    nsComponentManagerImpl()
    nsCycleCollector_init()
    nsCycleCollector_startup()
    SetICUMemoryFunctions()
    NesteggReporter()
    JS_Init()
    GetSingleton()
    InitStatics()
    do_GetService()
    Activate()
    NS_CreateServicesFromCategory()
    CreateAnonTempFileRemover()
    RegisterStrongMemoryReporter()
    ICUReporter()
    BackgroundHangMonitor()
    ShutdownXPCOM()
}

P_LOGI("the whole process: main()->RunProcesses()->b2g_main()->do_main()->XRE_main->ScopedXPCOMStartup::Initialize()->NS_InitXPCOM2()");

 

startup xpcom 的过程:

main()->RunProcesses()->b2g_main()->do_main()->XRE_main->ScopedXPCOMStartup::Initialize()->NS_InitXPCOM2()

NS_InitXPCOM2()主要的工作:

被XRE_main调用后,大的任务就是启动xpcom,细节为:创建如果是in XRE_IsParentProcess io thread,则创建main thread,并初始化线程管理器

rv=nsThreadManager::get()->Init()--->,启动读本地文件的模块,nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib)-->//读取xpt等接口二进制文件
 mozilla::Omnijar::IsInitialized = false,call mozilla::Omnijar::Init()--->//???

Create the Component/Service Manage----

nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl()--->//创建组件管理器,

f (!JS_Init()),call JS_Init()--->//调用JS_Init 启动并初始化js 引擎,

The iimanager constructor searches and registers XPT files.---//搜索并注册xpt接口文件提供的组件

 init SharedThreadPool ,by call  SharedThreadPool::InitStatics()--->//初始化共享线程池

componentLoader =    do_GetService('@mozilla.org/moz/jsloader;1')--->//通过xpcom方法拉起jsloader组件

NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY,nullptr,NS_XPCOM_STARTUP_OBSERVER_ID)//通知它开始自动注册组件

const MessageLoop* const loop = MessageLoop::current()--->//messageloop 一直在监听是否有新组件需要注册???

sMainHangMonitor=new mozilla::BackgroundHangMonitor(loop->thread_name().c_str(),loop->transient_hang_timeout(),loop->permanent_hang_timeout()) //将监听丢到后台去???

gecko/toolkit/xre/nsAppRunner.cpp:1584,Fuc:Initialize startup xpcom seccessed?? call do_QueryInterface(mServiceManager)-->

 

startup xpcom seccessed?? call do_QueryInterface(mServiceManager)-->//启动好xpcom后,开始调XRE_mainRun
gecko/toolkit/xre/nsAppRunner.cpp:4443, Fuc:XRE_main  call XRE_mainRun--->

XRE_mainRun还会调一次NS_NS_InitXPCOM2???

总结:

startup xpcom 的过程:

main()->RunProcesses()->b2g_main()->do_main()->XRE_main->ScopedXPCOMStartup::Initialize()->NS_InitXPCOM2()

NS_InitXPCOM2()主要的工作:大的来说就是启动xpcom。细节为: 在XRE_IsParentProcess 中创建main thread,并初始化线程管理器,启动读本地文件的模块nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib)并读取xpt等接口二进制文件,new nsComponentManagerImpl()创建组件管理器,调用JS_Init 启动并初始化js 引擎,搜索并注册xpt接口文件提供的组件,初始化共享线程池,通过xpcom方法拉起jsloader组件,通知NS_CreateServicesFromCategory开始自动注册其他xpcom组件。还有一些函数如MessageLoop,BackgroundHangMonitor似乎是用来监听一些线程的状态?启动好xpcom后,XRE_main开始调XRE_mainRun.

 

log如下:


gecko/b2g/app/nsBrowserApp.cpp:197, Fuc:do_main  call return XRE_main--->
gecko/b2g/app/nsBrowserApp.cpp:198, Fuc:do_main  <<<<<<<<<<<<<<<<<<<<<<<<<<<ed.func
gecko/toolkit/xre/nsAppRunner.cpp:4546, Fuc:XRE_main  >>>>>>>>>>>>>>>>>>>>>>>>>>>st.func
gecko/toolkit/xre/nsAppRunner.cpp:4548, Fuc:XRE_main  call XRE_CreateStatsObjecti--->
gecko/toolkit/xre/nsAppRunner.cpp:4550, Fuc:XRE_main  call main.XRE_main()--->
gecko/toolkit/xre/nsAppRunner.cpp:4380, Fuc:XRE_main  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:4385, Fuc:XRE_main  call profilerGuard--->
gecko/toolkit/xre/nsAppRunner.cpp:4395, Fuc:XRE_main  gArgc:1,gArgv:/system/b2g/b2g
gecko/toolkit/xre/nsAppRunner.cpp:4417, Fuc:XRE_main  call XRE_mainInit--->
gecko/toolkit/xre/nsAppRunner.cpp:3139, Fuc:XRE_mainInit  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:3217, Fuc:XRE_mainInit  chek for application.ini override 
gecko/toolkit/xre/nsAppRunner.cpp:3253, Fuc:XRE_mainInit  XRE_GetBinaryPath-->
gecko/toolkit/xre/nsAppRunner.cpp:3300, Fuc:XRE_mainInit  mDirProvider.Initialize-->
gecko/toolkit/xre/nsAppRunner.cpp:3309, Fuc:XRE_mainInit  MOZ_CRASHREPORTER
gecko/toolkit/xre/nsAppRunner.cpp:3503, Fuc:XRE_mainInit  call XRE_InitCommandLine()-->
gecko/toolkit/xre/nsAppRunner.cpp:4560, Fuc:XRE_InitCommandLine  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:4572, Fuc:XRE_InitCommandLine  XRE_GetBinaryPath(aArgv:/system/b2g/b2g)--->
gecko/toolkit/xre/nsAppRunner.cpp:3526, Fuc:XRE_mainInit  <<<<<<<<<<<<<<<<<<<<<<<<<<<ed.func
gecko/toolkit/xre/nsAppRunner.cpp:4423, Fuc:XRE_main  XRE_mainStartup--->
gecko/toolkit/xre/nsAppRunner.cpp:3657, Fuc:XRE_mainStartup  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:3663, Fuc:XRE_mainStartup  call SetShutdownChecks()-->
gecko/toolkit/xre/nsAppRunner.cpp:3963, Fuc:XRE_mainStartup  call BuildVersion-->
gecko/toolkit/xre/nsAppRunner.cpp:4049, Fuc:XRE_mainStartup  <<<<<<<<<<<<<<<<<<<<<<<<<<<ed.func
gecko/toolkit/xre/nsAppRunner.cpp:4431, Fuc:XRE_main  call MakeUnique--->
gecko/toolkit/xre/nsAppRunner.cpp:4436, Fuc:XRE_main  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:4437, Fuc:XRE_main   ScopedXPCOMStartup::Initialize()
gecko/toolkit/xre/nsAppRunner.cpp:4438, Fuc:XRE_main    rv = mScopedXPCOM->Initialize()--->
gecko/toolkit/xre/nsAppRunner.cpp:1571, Fuc:Initialize  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:1573, Fuc:Initialize  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:1575, Fuc:Initialize  ---here ,startup xpcom---
gecko/toolkit/xre/nsAppRunner.cpp:1576, Fuc:Initialize  ScopedXPCOMStartup::Initialize,call NS_InitXPCOM2-->
gecko/xpcom/build/XPCOMInit.cpp:512, Fuc:NS_InitXPCOM2  ----------------------------------
gecko/xpcom/build/XPCOMInit.cpp:513, Fuc:NS_InitXPCOM2  the whole process: main()->RunProcesses()->b2g_main()->do_main()->XRE_main->ScopedXPCOMStartup::Initialize()->NS_InitXPCOM2()
gecko/xpcom/build/XPCOMInit.cpp:514, Fuc:NS_InitXPCOM2  ----------------------------------
gecko/xpcom/build/XPCOMInit.cpp:560, Fuc:NS_InitXPCOM2  MessageLoop::current = false
gecko/xpcom/build/XPCOMInit.cpp:570, Fuc:NS_InitXPCOM2  in XRE_IsParentProcess io thread for what?---
gecko/xpcom/build/XPCOMInit.cpp:583, Fuc:NS_InitXPCOM2   Establish the main thread here.
gecko/xpcom/build/XPCOMInit.cpp:584, Fuc:NS_InitXPCOM2  rv = nsThreadManager::get()->Init()--->
gecko/xpcom/build/XPCOMInit.cpp:607, Fuc:NS_InitXPCOM2  call NS_StartupLocalFile()--->
gecko/xpcom/build/XPCOMInit.cpp:618, Fuc:NS_InitXPCOM2  aBinDirectory = true --
gecko/xpcom/build/XPCOMInit.cpp:626, Fuc:NS_InitXPCOM2  aAppFileLocationProvider = true,call RegisterProvider()-->
gecko/xpcom/build/XPCOMInit.cpp:634, Fuc:NS_InitXPCOM2    nsDirectoryService::gService->Get()--->
gecko/xpcom/build/XPCOMInit.cpp:646, Fuc:NS_InitXPCOM2   nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib)-->
gecko/xpcom/build/XPCOMInit.cpp:650, Fuc:NS_InitXPCOM2  mozilla::Omnijar::IsInitialized = false,call mozilla::Omnijar::Init()--->
gecko/xpcom/build/XPCOMInit.cpp:689, Fuc:NS_InitXPCOM2  Create the Component/Service Manage----
gecko/xpcom/build/XPCOMInit.cpp:690, Fuc:NS_InitXPCOM2    nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl()--->
gecko/xpcom/build/XPCOMInit.cpp:700, Fuc:NS_InitXPCOM2  call  nsCycleCollector_startup()--->
gecko/xpcom/build/XPCOMInit.cpp:737, Fuc:NS_InitXPCOM2  ----- Initialize the JS engine -----
gecko/xpcom/build/XPCOMInit.cpp:738, Fuc:NS_InitXPCOM2    if (!JS_Init()),call JS_Init()--->
gecko/xpcom/build/XPCOMInit.cpp:742, Fuc:NS_InitXPCOM2  call rv = nsComponentManagerImpl::gComponentManager->Init()--->
gecko/xpcom/build/XPCOMInit.cpp:755, Fuc:NS_InitXPCOM2   The iimanager constructor searches and registers XPT files.---
gecko/xpcom/build/XPCOMInit.cpp:756, Fuc:NS_InitXPCOM2    (void)XPTInterfaceInfoManager::GetSingleton()--->
gecko/xpcom/build/XPCOMInit.cpp:762, Fuc:NS_InitXPCOM2    nsDirectoryService::gService->RegisterCategoryProviders()-->
gecko/xpcom/build/XPCOMInit.cpp:766, Fuc:NS_InitXPCOM2  init SharedThreadPool ,by call  SharedThreadPool::InitStatics()--->
gecko/xpcom/build/XPCOMInit.cpp:770, Fuc:NS_InitXPCOM2    AbstractThread::InitStatics()--->
gecko/xpcom/build/XPCOMInit.cpp:775, Fuc:NS_InitXPCOM2  do_GetService of jsloader----
gecko/xpcom/build/XPCOMInit.cpp:776, Fuc:NS_InitXPCOM2   componentLoader =    do_GetService('@mozilla.org/moz/jsloader;1')--->
gecko/xpcom/build/XPCOMInit.cpp:784, Fuc:NS_InitXPCOM2    // Notify observers of xpcom autoregistration star//
gecko/xpcom/build/XPCOMInit.cpp:785, Fuc:NS_InitXPCOM2  NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY,nullptr,NS_XPCOM_STARTUP_OBSERVER_ID) --->
gecko/xpcom/build/XPCOMInit.cpp:797, Fuc:NS_InitXPCOM2   XRE_IsParentProcess =true,call  mozilla::SystemMemoryReporter::Init()--->
gecko/xpcom/build/XPCOMInit.cpp:811, Fuc:NS_InitXPCOM2    mozilla::Telemetry::Init()--->
gecko/xpcom/build/XPCOMInit.cpp:813, Fuc:NS_InitXPCOM2    mozilla::HangMonitor::Startup()--->
gecko/xpcom/build/XPCOMInit.cpp:815, Fuc:NS_InitXPCOM2    mozilla::BackgroundHangMonitor::Startup()--->
gecko/xpcom/build/XPCOMInit.cpp:817, Fuc:NS_InitXPCOM2    const MessageLoop* const loop = MessageLoop::current()--->
gecko/xpcom/build/XPCOMInit.cpp:819, Fuc:NS_InitXPCOM2  sMainHangMonitor = new mozilla::BackgroundHangMonitor(loop->thread_name().c_str(),loop->transient_hang_timeout(),loop->permanent_hang_timeout())  
gecko/toolkit/xre/nsAppRunner.cpp:1584, Fuc:Initialize  startup xpcom seccessed?? call do_QueryInterface(mServiceManager)-->
gecko/toolkit/xre/nsAppRunner.cpp:4443, Fuc:XRE_main  call XRE_mainRun--->
gecko/toolkit/xre/nsAppRunner.cpp:4060, Fuc:XRE_mainRun  ----------------------------------
gecko/ipc/glue/ProcessUtils_linux.cpp:231, Fuc:ProcLoaderClientGeckoInit  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:4088, Fuc:XRE_mainRun  call SetWindowCreator--->
gecko/toolkit/xre/nsAppRunner.cpp:4141, Fuc:XRE_mainRun  gDoMigration = 1 --->
gecko/toolkit/xre/nsAppRunner.cpp:4202, Fuc:XRE_mainRun  call mDirProvider.DoStartup()--->
gecko/toolkit/xre/nsAppRunner.cpp:4215, Fuc:XRE_mainRun  call appStartup->GetShuttingDown()-->
gecko/toolkit/xre/nsAppRunner.cpp:4295, Fuc:XRE_mainRun  call GetObserverService()-->
gecko/toolkit/xre/nsAppRunner.cpp:4300, Fuc:XRE_mainRun  appStartup->DoneStartingUp()-->
gecko/toolkit/xre/nsAppRunner.cpp:4338, Fuc:XRE_mainRun  appStartup->Run()-->
gecko/ipc/glue/ProcessUtils_linux.cpp:317, Fuc:ProcLoaderLoad  ----------------------------------
gecko/ipc/glue/ProcessUtils_linux.cpp:620, Fuc:ProcLoaderServiceRun  call BackgroundHangMonitor::Allow()--->
gecko/ipc/glue/ProcessUtils_linux.cpp:622, Fuc:ProcLoaderServiceRun  call XRE_DeinitCommandLine--->
gecko/ipc/glue/ProcessUtils_linux.cpp:629, Fuc:ProcLoaderServiceRun  call task->DoWork()--->
gecko/toolkit/xre/nsAppRunner.cpp:4560, Fuc:XRE_InitCommandLine  ----------------------------------
gecko/toolkit/xre/nsAppRunner.cpp:4572, Fuc:XRE_InitCommandLine  XRE_GetBinaryPath(aArgv:/system/b2g/plugin-container)--->
gecko/toolkit/xre/nsAppRunner.cpp:4629, Fuc:XRE_InitCommandLine  mozilla::Omnijar::Init(greOmni, appOmni)-->
gecko/ipc/glue/ProcessChild.cpp:46, Fuc:ProcessChild  >>>>>>>>>>>>>>>>>>>>>>>>>>>st.func
gecko/ipc/glue/ProcessUtils_linux.cpp:269, Fuc:ProcLoaderClientDeinit  ----------------------------------
gecko/xpcom/build/XPCOMInit.cpp:512, Fuc:NS_InitXPCOM2  ----------------------------------
gecko/xpcom/build/XPCOMInit.cpp:513, Fuc:NS_InitXPCOM2  the whole process: main()->RunProcesses()->b2g_main()->do_main()->XRE_main->ScopedXPCOMStartup::Initialize()->NS_InitXPCOM2()
gecko/xpcom/build/XPCOMInit.cpp:514, Fuc:NS_InitXPCOM2  ----------------------------------
gecko/xpcom/build/XPCOMInit.cpp:583, Fuc:NS_InitXPCOM2   Establish the main thread here.
gecko/xpcom/build/XPCOMInit.cpp:584, Fuc:NS_InitXPCOM2  rv = nsThreadManager::get()->Init()--->
gecko/xpcom/build/XPCOMInit.cpp:607, Fuc:NS_InitXPCOM2  call NS_StartupLocalFile()--->
gecko/xpcom/build/XPCOMInit.cpp:618, Fuc:NS_InitXPCOM2  aBinDirectory = true --
gecko/xpcom/build/XPCOMInit.cpp:626, Fuc:NS_InitXPCOM2  aAppFileLocationProvider = true,call RegisterProvider()-->
gecko/xpcom/build/XPCOMInit.cpp:634, Fuc:NS_InitXPCOM2    nsDirectoryService::gService->Get()--->
gecko/xpcom/build/XPCOMInit.cpp:646, Fuc:NS_InitXPCOM2   nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib)-->
gecko/xpcom/build/XPCOMInit.cpp:689, Fuc:NS_InitXPCOM2  Create the Component/Service Manage----
gecko/xpcom/build/XPCOMInit.cpp:690, Fuc:NS_InitXPCOM2    nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl()--->
gecko/xpcom/build/XPCOMInit.cpp:700, Fuc:NS_InitXPCOM2  call  nsCycleCollector_startup()--->
gecko/xpcom/build/XPCOMInit.cpp:737, Fuc:NS_InitXPCOM2  ----- Initialize the JS engine -----
gecko/xpcom/build/XPCOMInit.cpp:738, Fuc:NS_InitXPCOM2    if (!JS_Init()),call JS_Init()--->
gecko/xpcom/build/XPCOMInit.cpp:742, Fuc:NS_InitXPCOM2  call rv = nsComponentManagerImpl::gComponentManager->Init()--->
gecko/xpcom/build/XPCOMInit.cpp:755, Fuc:NS_InitXPCOM2   The iimanager constructor searches and registers XPT files.---
gecko/xpcom/build/XPCOMInit.cpp:756, Fuc:NS_InitXPCOM2    (void)XPTInterfaceInfoManager::GetSingleton()--->
gecko/xpcom/build/XPCOMInit.cpp:762, Fuc:NS_InitXPCOM2    nsDirectoryService::gService->RegisterCategoryProviders()-->
gecko/xpcom/build/XPCOMInit.cpp:766, Fuc:NS_InitXPCOM2  init SharedThreadPool ,by call  SharedThreadPool::InitStatics()--->
gecko/xpcom/build/XPCOMInit.cpp:770, Fuc:NS_InitXPCOM2    AbstractThread::InitStatics()--->
gecko/xpcom/build/XPCOMInit.cpp:775, Fuc:NS_InitXPCOM2  do_GetService of jsloader----
gecko/xpcom/build/XPCOMInit.cpp:776, Fuc:NS_InitXPCOM2   componentLoader =    do_GetService('@mozilla.org/moz/jsloader;1')--->
gecko/xpcom/build/XPCOMInit.cpp:784, Fuc:NS_InitXPCOM2    // Notify observers of xpcom autoregistration star//
gecko/xpcom/build/XPCOMInit.cpp:785, Fuc:NS_InitXPCOM2  NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY,nullptr,NS_XPCOM_STARTUP_OBSERVER_ID) --->
gecko/xpcom/build/XPCOMInit.cpp:811, Fuc:NS_InitXPCOM2    mozilla::Telemetry::Init()--->
gecko/xpcom/build/XPCOMInit.cpp:813, Fuc:NS_InitXPCOM2    mozilla::HangMonitor::Startup()--->
gecko/xpcom/build/XPCOMInit.cpp:815, Fuc:NS_InitXPCOM2    mozilla::BackgroundHangMonitor::Startup()--->
gecko/xpcom/build/XPCOMInit.cpp:817, Fuc:NS_InitXPCOM2    const MessageLoop* const loop = MessageLoop::current()--->
gecko/xpcom/build/XPCOMInit.cpp:819, Fuc:NS_InitXPCOM2  sMainHangMonitor = new mozilla::BackgroundHangMonitor(loop->thread_name().c_str(),loop->transient_hang_timeout(),loop->permanent_hang_timeout())  

 

 

 

西汉BC76年世界历史地图矢量文件SHP格式.zip 本资源为《西汉BC76年世界历史地图矢量文件SHP格式》压缩包,文件大小约 2.23 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。 立即下载

相关推荐

西汉BC23年世界历史地图矢量文件SHP格式.zip

本资源为《西汉BC23年世界历史地图矢量文件SHP格式》压缩包,文件大小约 2.14 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

b2g process: XREMain::XRE_mainRun

b2g process 中到后面主要的几个大模块: 结构图抄自:https://blog.csdn.net/zembers/article/details/48495627 |-XRE_main | |-XREMain::XRE_main | |-new ScopedAppData(aAppData); | |-XREMain::XR...

hunter 380

战国BC467年世界历史地图矢量文件SHP格式.zip

本资源为《战国BC467年世界历史地图矢量文件SHP格式》压缩包,文件大小约 2.26 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

应用的启动及b2g,nuwa,preallocated ,app 间消息的获取与传输

应用的启动及b2g,nuwa,preallocated ,app 消息的获取与传输。 几个阶段: 1.b2g 初始化自身,并请求与Prenuwa 连接,(做好准备,各种数据及环境配置窗口创建等)目的是Load Nuwa。(入口/nsAppRunner.cpp:4349,Fun:XRE_mainRun) nsAppStartup.cpp:320,Fun:Run 作为与PreNuwa的接口吧?(...

hunter 545

西汉BC97年世界历史地图矢量文件SHP格式.zip

本资源为《西汉BC97年世界历史地图矢量文件SHP格式》压缩包,文件大小约 2.22 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

问:科研人员发布成果后难以找到精准匹配的企业,有哪些智能化工具可以快速发布成果并实现供需对接?.docx

问:科研人员发布成果后难以找到精准匹配的企业,有哪些智能化工具可以快速发布成果并实现供需对接?

ffos:B2G IPC internals,nuwa process and b2g process

https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/Security/B2G_IPC_internals Architecture In FirefoxOS we have a Multi-process Architecture where the apps on the phone are running in a differ...

hunter 334

技术转移机构在拓展企业服务时,最常见的痛点有哪些以及如何解决?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

b2g入口:b2g做了些什么工作

之前看的是init到系统启动到system app再到system app 将其他核心应用启动起来的过程。那么支持上层应用的底层(gecko 层的这些组件又做了什么呢?) 启动过程总览: 物理按键----&gt;固件(firmware)---&gt;(加载/启动)内核(kernel)----&gt;init进程---&gt;解析init.rc/init.b2g.rc(有b2g.sh)----&...

hunter 945

水下无人航行器UUV三维路径跟踪、LOS+反步优化控制程序、三维螺旋线速度+角度(Matlab代码实现)

内容概要:本文档系统阐述了水下无人航行器(UUV)在三维空间中的路径跟踪控制技术,聚焦于基于视线引导(Line-of-Sight, LOS)与反步法(Backstepping)相结合的优化控制策略的设计与实现,并通过Matlab平台完成三维螺旋线轨迹下的仿真验证。文档详细涵盖了UUV的动力学建模、非线性与强耦合特性分析、控制器设计流程、仿真步骤及结果评估,重点解析了LOS导引律在路径趋近中的应用与反步法在系统稳定性控制中的递归设计机制。此外,资源还整合了滑模控制、模型预测控制(MPC)、自适应神经网络控制等多种先进控制方法在UUV及无人船系统中的应用案例,配套提供完整的Matlab代码与详尽说明文档,支持算法复现与科研拓展。; 适合人群:具备自动控制理论基础和Matlab编程能力,从事海洋工程、智能控制、机器人导航与路径规划等领域的研究生、科研人员及工程技术人员。; 使用场景及目标:① 实现UUV在复杂海洋环境下高精度的三维路径跟踪控制;② 深入理解并掌握LOS导引律与反步法在非线性欠驱动系统中的协同设计与稳定性分析方法;③ 借助提供的仿真代码开展先进控制算法的对比研究与优化设计,支撑学术论文撰写、课题攻关或工程项目开发; 阅读建议:建议结合Matlab代码逐模块剖析,重点关注控制律构建与李雅普诺夫稳定性证明过程,同时对比PID、滑模、MPC等不同控制策略的跟踪性能差异,深入探究其在实际工程系统中的适用边界与优化潜力。

智能车赛道识别:八邻域算法的实战解析与优化

本文深入解析了智能车赛道识别中八邻域算法的核心原理与实战优化。作为兼顾性能与稳定性的经典方案,该算法通过模拟探险家环顾八方的策略,能精准追踪弯道与直道边界。文章详细拆解了代码逻辑,并提供了边界平滑、异常处理及应对十字路口、环岛等复杂场景的关键优化策略,助力开发者提升智能车视觉系统的鲁棒性与实时性。

weixin_29228781的博客 267

b2g loader: loadstaticdata

  sourcecode:(brief v) static bool LoadStaticData(int argc, const char *argv[]) { bool ok = GetXPCOMPath(argv[0], xpcomPath, MAXPATHLEN); ok = LoadLibxul(xpcomPath); ok = GetDirnameSlash(xpco...

hunter 454

CVAT本地部署保姆级教程:用Docker Compose在Ubuntu上5分钟搞定你的私有数据标注平台

本文提供CVAT本地部署的保姆级教程,详细讲解如何在Ubuntu系统上使用Docker Compose快速搭建私有数据标注平台。从环境准备、Docker配置到CVAT部署全流程,涵盖硬件要求、性能优化及安全加固等关键步骤,帮助开发团队5分钟内完成高效、安全的标注环境搭建。

weixin_42619742的博客 391

ffos: 点击一个web app图标到完成相应进程并正常运行过程分析

https://blog.csdn.net/hunter___/article/details/83141151 https://blog.csdn.net/hunter___/article/details/83180552 https://blog.csdn.net/hunter___/article/details/83105479 https://blog.csdn.net/hunt...

hunter 399

ETL数据集成案例

一个典型的ETL数据集成案例是将多个来源的数据合并成一个数据集。假设有一个公司,该公司使用一些不同的系统来存储不同部门的数据,例如销售数据存储在一个CRM系统中,财务数据存储在一个ERP系统中,人力资源数据存储在一个HR系统中。为了更好地进行报告和分析,该公司决定将所有这些数据集成到一个数据仓库中。以下是实现这一目标的ETL过程的步骤:提取(Extract):首先,需要从每个系统中提取所需的数据。每个系统可能有不同的数据格式和结构,因此需要编写不同的提取程序或查询来提取数据。

runqu的博客 952

解决MATLAB2020B关于找不到vs2019C++编译器问题

解决MATLAB2020B关于找不到vs2019C++编译器问题

wcm2577的博客 7611

b2g process 和nuwa process 通信

它们通信的目的在于: b2g要发消息给nuwa,让它fork出web app进程。它们发生在nuwa进程已经完全启动,并准备好fork 其他app子进程。猜想,用的是socket pair 建立关系,ipdl(最终用的是共享内存读写)进行线程级别的信息交互。socket pair只是用于建立通道??? nuwa的操作,从b2g开始fork出两个进程之后,兵分两路,nuwa进程完成自己的所有初始...

hunter 455

CSP-J2019普及组复赛T4:加工零件

CSP-J2020普及组复赛T1:优秀的拆分,广度优先遍历求最短路。

少儿编程乔老师 1860

gecko 相关process分析 大纲,代码总结性结论

1分别分析b2g process 2和nuwa process, 3 分析b2g 与nuwa的通信交互 4分析messageloop,ipdl 5分析APP如何启动     结构:                     |-XRE_main                                |                        ...

hunter 913

PCIe 6.0 – 关于 PCI Express Gen6 您需要知道的一切

幸运的是,PCIe 6.0 FEC 足够轻,对延迟的影响最小。在电气层上,PCIe 6.0 使用 PAM4 信号(“四级脉冲幅度调制”),每个时钟周期将 2 位组合为 4 个幅度级别(00、01、10、11),与 PCIe 5.0 和前几代相比,它使用 NRZ 调制,每个时钟周期 1 位和两个幅度级别 (0, 1)。虽然 PAM4 信号更容易出错,但由于调制技术的性质,与 PCIe 5.0 相比,通道损耗不受影响,因此 PCB 上 PCIe 6.0 信号的范围将与 PCIe 5.0 相同。

qq_43416206的博客 3441

基于STM32设计的消防小车

当前基于STM32单片机设计了一款智能消防小车;当前小车支持烟雾浓度检测、可燃气体检测,环境温度湿度检测、火焰源检测、能支持远程遥控,方便消防员远程操控进行灭火。小车也支持自动消防,在行驶过程中,消防智能小车通过火焰传感器感应火源以检测火焰具体位置,可以利用算法设计进行循迹灭火,该模式下驱动电机水泵喷水,可以有效控制火源的第二次发生,从而完成消防作业。小车本身带了超声波测距模块,红外壁障模块,在自动或者手动控制行驶过程中可以防止碰到障碍物损伤小车。

7390

firefox调试记录3——其他情况的跟踪

其他情况主要包括: 环境设置不做变动,保持默认值。 设置为启动firefox时打开空白页/打开主页等 环境设置保持默认值 直接按F10,开始调试。这一次没有打开profilemanager,而是直接使用了电脑上的默认profile。打开了主页。跟踪依据最开始的跟踪方式,在确定需要跟进的地方按F11,其他地方按F10,不过,在~\firefox-8.0.source\toolkit\xr

JumuFENG's blog 1339

PCL 从LAS文件中获取点云的颜色【2027最新版】

PCL从LAS文件中获取点云的RGB信息(pcl::PointXYZRGB)并进行可视化。博客长期更新,本文最新更新时间为:2026年12月1日。

点云侠的博客 1730

ffos:gecko 内核之ProcLoader,进程加载器分析PProcLoader--ipdl

b2g与nuwa相互通信的具体ipdl源码分析: ipdl机制分析: PProcLoader.ipdl接口定义文件: objdir-gecko/ipc/ipdl/PProcLoader PProcLoaderChild.cpp   PProcLoader.cpp        PProcLoaderParent.cpp   接口文件:  PProcLoader.ipdl ...

hunter 426

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

[MTK]如何默认打开user debug 选项

[Description] 如何默认打开user debug 选项   [Keyword] user debug root   [Solution] 1. 在android 4.0 之前,这个设置是在frameworks/base/service/..../SystemServer.java 里面设置会根据system property 的persist.service.adb.en

duanlove(技术路途)专栏 3839

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

b2g crash record

1. https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/B2G_OS_build_prerequisites2. make 3.82

hunter 270

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

上一篇: git常用操作
下一篇: ubuntu用git-daemon搭建git服务器和配置方法
nedwons
博客等级 码龄9年 311粉丝 572原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值