This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new c01aca09f02 boards/qemu-i486: Fix the removal of qemu_appinit.c
c01aca09f02 is described below

commit c01aca09f0225b8c07a1c207f9cf41055275e3d3
Author: Alan Carvalho de Assis <[email protected]>
AuthorDate: Sat May 2 11:47:24 2026 -0300

    boards/qemu-i486: Fix the removal of qemu_appinit.c
    
    This PR makes the qemu-i486 boot again.
    
    Signed-off-by: Alan C. Assis <[email protected]>
---
 boards/x86/qemu/qemu-i486/src/Makefile             |  2 +-
 boards/x86/qemu/qemu-i486/src/qemu_boot.c          | 12 +---
 .../qemu-i486/src/{qemu_i486.h => qemu_bringup.c}  | 72 +++++++++++++++++-----
 boards/x86/qemu/qemu-i486/src/qemu_i486.h          | 13 ++++
 4 files changed, 72 insertions(+), 27 deletions(-)

diff --git a/boards/x86/qemu/qemu-i486/src/Makefile 
b/boards/x86/qemu/qemu-i486/src/Makefile
index 5a6c130d33e..2620a6beda1 100644
--- a/boards/x86/qemu/qemu-i486/src/Makefile
+++ b/boards/x86/qemu/qemu-i486/src/Makefile
@@ -22,7 +22,7 @@
 
 include $(TOPDIR)/Make.defs
 
-CSRCS = qemu_boot.c
+CSRCS = qemu_boot.c qemu_bringup.c
 
 ifeq ($(CONFIG_QEMU_VGA),y)
   CSRCS += qemu_vga_lcd.c
diff --git a/boards/x86/qemu/qemu-i486/src/qemu_boot.c 
b/boards/x86/qemu/qemu-i486/src/qemu_boot.c
index 381dcf8a984..f12429aaf7c 100644
--- a/boards/x86/qemu/qemu-i486/src/qemu_boot.c
+++ b/boards/x86/qemu/qemu-i486/src/qemu_boot.c
@@ -87,16 +87,8 @@ void x86_boardinitialize(void)
 #ifdef CONFIG_BOARD_LATE_INITIALIZE
 void board_late_initialize(void)
 {
-#ifdef CONFIG_FS_PROCFS
-  int ret = OK;
+  /* Perform board-specific initialization */
 
-  /* Mount the proc filesystem */
-
-  ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
-  if (ret < 0)
-    {
-      serr("ERROR: Failed to mount procfs at %s: %d\n", "/proc", ret);
-    }
-#endif
+  qemu_bringup();
 }
 #endif /* CONFIG_BOARD_LATE_INITIALIZE */
diff --git a/boards/x86/qemu/qemu-i486/src/qemu_i486.h 
b/boards/x86/qemu/qemu-i486/src/qemu_bringup.c
similarity index 59%
copy from boards/x86/qemu/qemu-i486/src/qemu_i486.h
copy to boards/x86/qemu/qemu-i486/src/qemu_bringup.c
index b5e237826aa..2bb9799c9c1 100644
--- a/boards/x86/qemu/qemu-i486/src/qemu_i486.h
+++ b/boards/x86/qemu/qemu-i486/src/qemu_bringup.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * boards/x86/qemu/qemu-i486/src/qemu_i486.h
+ * boards/x86/qemu/qemu-i486/src/qemu_bringup.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -20,35 +20,75 @@
  *
  ****************************************************************************/
 
-#ifndef __BOARDS_X86_QEMU_QEMU_I486_SRC_QEMU_I486_H
-#define __BOARDS_X86_QEMU_QEMU_I486_SRC_QEMU_I486_H
-
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
-#include <nuttx/compiler.h>
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
+#include <errno.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <nuttx/debug.h>
+#include <nuttx/video/fb.h>
+#include <nuttx/fs/fs.h>
 
-/* GPIO Pin Definitions *****************************************************/
+#include "x86_internal.h"
+#include "qemu_vga.h"
 
 /****************************************************************************
- * Public Types
+ * Public Functions
  ****************************************************************************/
 
 /****************************************************************************
- * Public Data
+ *
  ****************************************************************************/
 
-#ifndef __ASSEMBLY__
-
 /****************************************************************************
- * Public Functions Definitions
+ * Name: qemu_bringup
+ *
+ * Description:
+ *   Perform architecture-specific initialization
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y :
+ *     Called from board_late_initialize().
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_BOARDCTL=y :
+ *     Called from the NSH library
+ *
  ****************************************************************************/
 
-#endif /* __ASSEMBLY__ */
-#endif /* __BOARDS_X86_QEMU_QEMU_I486_SRC_QEMU_I486_H */
+int qemu_bringup(void)
+{
+  int ret = OK;
+
+#ifdef CONFIG_FS_PROCFS
+  /* Mount the proc filesystem */
+
+  ret = nx_mount(NULL, "/proc", "procfs", 0, NULL);
+  if (ret < 0)
+    {
+      serr("ERROR: Failed to mount procfs at %s: %d\n", "/proc", ret);
+    }
+#endif
+
+#ifdef CONFIG_QEMU_VGA
+  ret = qemu_vga();
+  if (ret < 0)
+    {
+      serr("ERROR: Failed to initialize QEMU VGA: %d\n", ret);
+    }
+#endif
+
+#ifdef CONFIG_VIDEO_FB
+  /* Initialize and register the framebuffer driver */
+
+  ret = fb_register(0, 0);
+  if (ret < 0)
+    {
+      serr("ERROR: fb_register() failed: %d\n", ret);
+    }
+#endif
+
+  return ret;
+}
diff --git a/boards/x86/qemu/qemu-i486/src/qemu_i486.h 
b/boards/x86/qemu/qemu-i486/src/qemu_i486.h
index b5e237826aa..a287c00ba11 100644
--- a/boards/x86/qemu/qemu-i486/src/qemu_i486.h
+++ b/boards/x86/qemu/qemu-i486/src/qemu_i486.h
@@ -50,5 +50,18 @@
  * Public Functions Definitions
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: qemu_bringup
+ *
+ * Description:
+ *   Perform architecture-specific initialization
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y :
+ *     Called from board_late_initialize().
+ *
+ ****************************************************************************/
+
+int qemu_bringup(void);
+
 #endif /* __ASSEMBLY__ */
 #endif /* __BOARDS_X86_QEMU_QEMU_I486_SRC_QEMU_I486_H */

Reply via email to